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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
raj777karthik
Microsoft Employee
Microsoft Employee

To combine multiple rows of id into single cell

In Power query i have an ID whose description is very long and so it is taking as three records for single id.I need to bring them as single row with all its description .

= Table.Group(#"Changed Type", {"ID"}, {{"Count", each Text.Combine([Merged],";"), type text}})

ID     Desc     length(Desc)

1       abc...      652

1       xyz...       4096

1       pqr...       4096

As per google i have used  group by using id and in query editor  i have used text.combine as well .But still it didnt work.

ID     Desc     length(Desc)

1       abc...      652

Im getting this result now...

 

My output shold be

ID   Desc

1    abcxyzpqr.......

 

Length i have included as example

 

PLease suggest any idea 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

try this

 

let
    comb=(desc)=> Text.Combine(desc,"#-#"),


    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("7ZjBjpswEIZfxeIag9Jqo8JxtnQWDCnRumgPqxwsUZvYaEFFq6pvw7FnXsEv1slmlSeoqlSyhcb/eAY+RvpPfn6OPkQ8siL3S279Qo+y2i9Ok6pQMNXrwa+9qpVftdObabQIAvwyUMOgdIF+AWcH7ew8OOOoWc2m74ber9ZRmA2blemYYWo+R8poO+uLZN2sSF4OKNIiYd4OzflNdcmpaLpfP77/fGWvllmmLR1bIjJt3pd2pmeOOaOZ00abWMeaytPIJzaN42kaN6eT20RHfpm6bJtSFVDUfi1YVcNXGnToAWmvXxTNvVil5xea3OpzYAlXXTfrwTmlOVfI/tk/B9L/Qbp6697/PmyaLL3biYrs9MA/J/dxdWi+PVKGecLzJJbZXUpljOMC00+x5PiEX/zabJ9KlCJO9nuEfYyMBaMG0t8mBU8FUvBUIN06KXgqkIKnAunWScFTgRQ8FUg3Tnq7oPgY8agSdYV+FVCDX/xCcYX6WhUFiqrwawUFNWENpAEpFAjXJonnj9QoOUpIYJvJnV+3GaTZLt2DxIQsK7F8bMsWBcQI0i8HyNqmLR6EzEFGx+Mf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, desc = _t]),
    #"Raggruppate righe" = Table.Group(Origine, {"id"}, {{"all", each comb(_[desc])}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Raggruppate righe", "len", each Text.Length([all]))
in
    #"Aggiunta colonna personalizzata"

View solution in original post

1 REPLY 1
Anonymous
Not applicable

try this

 

let
    comb=(desc)=> Text.Combine(desc,"#-#"),


    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("7ZjBjpswEIZfxeIag9Jqo8JxtnQWDCnRumgPqxwsUZvYaEFFq6pvw7FnXsEv1slmlSeoqlSyhcb/eAY+RvpPfn6OPkQ8siL3S279Qo+y2i9Ok6pQMNXrwa+9qpVftdObabQIAvwyUMOgdIF+AWcH7ew8OOOoWc2m74ber9ZRmA2blemYYWo+R8poO+uLZN2sSF4OKNIiYd4OzflNdcmpaLpfP77/fGWvllmmLR1bIjJt3pd2pmeOOaOZ00abWMeaytPIJzaN42kaN6eT20RHfpm6bJtSFVDUfi1YVcNXGnToAWmvXxTNvVil5xea3OpzYAlXXTfrwTmlOVfI/tk/B9L/Qbp6697/PmyaLL3biYrs9MA/J/dxdWi+PVKGecLzJJbZXUpljOMC00+x5PiEX/zabJ9KlCJO9nuEfYyMBaMG0t8mBU8FUvBUIN06KXgqkIKnAunWScFTgRQ8FUg3Tnq7oPgY8agSdYV+FVCDX/xCcYX6WhUFiqrwawUFNWENpAEpFAjXJonnj9QoOUpIYJvJnV+3GaTZLt2DxIQsK7F8bMsWBcQI0i8HyNqmLR6EzEFGx+Mf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, desc = _t]),
    #"Raggruppate righe" = Table.Group(Origine, {"id"}, {{"all", each comb(_[desc])}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Raggruppate righe", "len", each Text.Length([all]))
in
    #"Aggiunta colonna personalizzata"

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors