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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Table transformation

I have a table that looks like this - 

 

IDFinancial Code
1123
2456
3789
3102
2223
1413

 

And, I'd like to transform it into the following table as it enables me to have a single record for each ID. 

 

IDFinancial Code
1123, 413
2456, 223
3

789, 102

 

Please can someone help me understand how I go about this? 

2 REPLIES 2
Anonymous
Not applicable

HI @Anonymous,

You can also do these operations on the query editor side to transfer your table structure: (Table.Group nested with Text.Combine function)

1.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0MlaK1YlWMgKyTUzNwGxjINvcwhLONjQwgqsxgqoH6TUxBLJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Financial Code" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Financial Code", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Merge", each Text.Combine(List.Transform(_[Financial Code], each Text.From(_)),","), type text }})
in
    #"Grouped Rows"

Regards,

Xiaoxin Sheng

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can create a measure like below:-

Measure = 
    CONCATENATEX ( VALUES ('Table'[Financial Code] ), [Financial Code], "," )

 

Output:-

Samarth_18_0-1646030322272.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors