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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
StoryofData
Helper III
Helper III

Group By and List

I am trying to group by [case],[case status] and [case practice] and create a list from [title], fiddiling around with power query but cannot figure out how to group AND create a list, can anyone please help?

StoryofData_0-1679071942583.png

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXLMS8ypLC5RitWJVjIC8n0T8xLTU4vgfHR5l8yi1OSSfIgCY5CC4uL85MzEklSl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Case = _t, Title = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Case", Int64.Type}, {"Title", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Case"}, {{"Rows", each _, type table [Case=nullable number, Title=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Title", each Text.Combine([Rows][Title],",")),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Case", "Title"})
in
    #"Removed Other Columns"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXLMS8ypLC5RitWJVjIC8n0T8xLTU4vgfHR5l8yi1OSSfIgCY5CC4uL85MzEklSl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Case = _t, Title = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Case", Int64.Type}, {"Title", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Case"}, {{"Rows", each _, type table [Case=nullable number, Title=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Title", each Text.Combine([Rows][Title],",")),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Case", "Title"})
in
    #"Removed Other Columns"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

Thank you so much!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.