Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Crisse
New Member

Counting how many times certain word is in column per row

hi

 

I have tried to understand how to calculate next

 

I have roughly 5000 rows in table1

I have column "Info requests" in my table and it includes data like

 

caseID                           info requests

11111                            

11112                            responded;

11113                            responded; waiting response

11114                            responded; responded; cancelled

11115                            cancelled; responded;

 

Now I want to create new column which includes information how many times responded has been visible for each caseID

my expectation is to have next kind of info

 

caseID                           info requests                                             IR responded

11111                                                                                          

11112                            responded;                                               1

11113                            responded; waiting response;                  1

11114                            responded; responded; cancelled;            2

11115                            cancelled; responded;                              1

 

I do not know how to do it, can you help?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Crisse ,

 

You may also add a custom column.

List.Count(Text.Split([info requests], "responded")) - 1
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Crisse ,

 

You may also add a custom column.

List.Count(Text.Split([info requests], "responded")) - 1
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PattemManohar
Community Champion
Community Champion

@Crisse  Please try using "Split Column" and "Group By" options to achieve this in Power Query Editor.

 

Here is the M-code generated by using those two steps on the sample data.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMgQBJR0lpVgdCMcIyClKLS7Iz0tJTbGGCxujCJcnZpZk5qUrQESKUxHqTFDUIVjJiXnJqTk5yEaaApUihJHtjAUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [CaseID = _t, InfoRequests = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"CaseID", Int64.Type}, {"InfoRequests", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"InfoRequests", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "InfoRequests"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"InfoRequests", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type1", {"CaseID", "InfoRequests"}, {{"CountResponded", each Table.RowCount(_), type number}}),
    #"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each ([InfoRequests] = "responded"))
in
    #"Filtered Rows"

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@Crisse 

 

As a calculated column in DAX you can use

 

Column =
PATHLENGTH ( SUBSTITUTE ( [info requests], "responded", "|" ) ) - 1

pathtocount.png

Thank You, I manage to get at least some data 😉

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors