textpowerbi

Power BI: Count the number of times a text appears in each row


I have a column that shows the tickets assigned to each user. For example, User1 has "ticket2, ticket4, ticket5". User2 has "ticket1, ticket3". I want to count the number of tickets each user has. I can't use the number of words separated by commas as a criterion, for example, because User3 can have something like "ticket6, ticket7, HHGG", where HHGG stands for something else. How can I do that?

I tried converting each of the rows with the tickets into a list, to count the number of items, but I don't know how to filter the ones that I need. I used: Count = Table.AddColumn(#"Added Conditional Column2", "INC Count", each Text.Split([#"SNow#"], ","))


Solution

  • If your data size is relatively small you could try adding a custom column with the code:

    List.Count(Text.PositionOf([Test], "ticket", Occurrence.All))

    enter image description here