Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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?
Solved! Go to Solution.
@Crisse ,
You may also add a custom column.
List.Count(Text.Split([info requests], "responded")) - 1
@Crisse ,
You may also add a custom column.
List.Count(Text.Split([info requests], "responded")) - 1
@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"
Proud to be a PBI Community Champion
As a calculated column in DAX you can use
Column = PATHLENGTH ( SUBSTITUTE ( [info requests], "responded", "|" ) ) - 1
Thank You, I manage to get at least some data 😉