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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Cado_one
Resolver III
Resolver III

Split values from different rows of a same column into a single row

Hi,

 

my problem is simple but I don't find any good solution on internet.

Below is what I have :

column1.idcolumn2.idColumn3
2850718012Date1
2850718012Value1
2852880592Date2
2852880592Value2

 

And here is what I want :

Column1.idColumn2.idDatesValues
2850718012Date1Value1
2852880592Date2Value2

 

Any suggestion will be appreciated.

Thanks in advance,

Cado

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Cado_one 

Paste below code in a blank query in the advanced editor.

The idea is summarize by the 1st two columns and sum the 3rd column then replace the List.Sum() with Text.Combine([Column3],",")

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrIwNVDSUTI3tDAwNAIyXBJLUg2VYnUwZcISc0oRUiARCwsDU0uYJiOsMmBNQKlYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [column1.id = _t, column2.id = _t, Column3 = _t]),
    #"Grouped Rows" = Table.Group(Source, {"column1.id", "column2.id"}, {{"Count", each Text.Combine([Column3],","), type nullable text}})
in
    #"Grouped Rows"

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Cado_one 

Paste below code in a blank query in the advanced editor.

The idea is summarize by the 1st two columns and sum the 3rd column then replace the List.Sum() with Text.Combine([Column3],",")

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrIwNVDSUTI3tDAwNAIyXBJLUg2VYnUwZcISc0oRUiARCwsDU0uYJiOsMmBNQKlYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [column1.id = _t, column2.id = _t, Column3 = _t]),
    #"Grouped Rows" = Table.Group(Source, {"column1.id", "column2.id"}, {{"Count", each Text.Combine([Column3],","), type nullable text}})
in
    #"Grouped Rows"

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @ziying35 @Fowmy 

 

Thanks you for your responses !

 

@ziying35 your code give me an error : The column 'Column1.id' of the table wasn't found.

@Fowmy your code give me an error : 4 keys were specified, but 3 values were provided.

 

In order to understand the first operation and to be able to do it again by myself, could you please show/tell me of to do the trick manually ?

 

Cado

@Cado_one 


Check this out: HERE

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Exactly what I needed !

Thank you very much both of you for the help @Fowmy @ziying35 

@Cado_one 

You are welcome!

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

ziying35
Impactful Individual
Impactful Individual

Hi, @Cado_one 

 

 

let
    Source = Table.FromRecords(Json.Document(Binary.Decompress(Binary.FromText("i65WSs7PKc3NM9TLTFGyMrIwNdCBihiBRcwNLQwMjXSUnMFixkpWSi6JJamGSrU6pOsMS8wpxa7VCFWrhYWBqSWGpUZk6QRbCtQaCwA=",BinaryEncoding.Base64),Compression.Deflate))),
    group = Table.Group(Source, {"column1.id", "column2.id"}, {"Foo", each Record.FromList([Column3],{"Dates", "Values"})  }),
    expd = Table.ExpandRecordColumn(group, "Foo", {"Dates", "Values"})
in
    expd

 

 

 If my code solves your problem, mark it as a solution

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.