Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello Forks,
I have data like this on my power query
| PersonID | Language |
| 184 | Tukrish |
| 184 | English |
| 1255 | Arabic |
| 1255 | English |
| 1255 | Turkish |
and I want to show this data like this
| PersonID | Language1 | Language2 | Language3 |
| 184 | Tukrish | English | |
| 1255 | Arabic | English | Turkish |
If Anyone have any idea please help
Solved! Go to Solution.
Hi @cu-admin, different approach here.
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQwUdJRCinNLsoszlCK1YGJuOal58BFjExNgUKORYlJmcnIIlgUhZQWZYOFYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [PersonID = _t, Language = _t]),
GroupedRows = Table.Group(Source, {"PersonID"}, {{"Count", Table.RowCount}, {"All", each
[ a = Table.Transpose(Table.SelectColumns(_, {"Language"})),
b = List.Transform({ 1..Table.ColumnCount(a) }, (x)=> "Language" & Text.From(x)),
c = List.Zip({ Table.ColumnNames(a), b }),
d = Table.RenameColumns(a, c)
][d], type table}}),
ExpandedAll = Table.RemoveColumns(Table.ExpandTableColumn(GroupedRows, "All", List.Transform({ 1..List.Max(GroupedRows[Count]) }, each "Language" & Text.From(_))), {"Count"})
in
ExpandedAll
Hi, one more solution
let
Source = Your_Source,
GroupedRows = Table.Group(Source, {"PersonID"},
{{"All", each #table(
{"PersonID"} & List.Transform({ 1..Table.RowCount(_)}, each "Language" & Text.From(_)),
{{[PersonID]{0}} & [Language]} )
}}),
Combine = Table.Combine(GroupedRows[All])
in
Combine
Stéphane
Hi @cu-admin, different approach here.
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQwUdJRCinNLsoszlCK1YGJuOal58BFjExNgUKORYlJmcnIIlgUhZQWZYOFYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [PersonID = _t, Language = _t]),
GroupedRows = Table.Group(Source, {"PersonID"}, {{"Count", Table.RowCount}, {"All", each
[ a = Table.Transpose(Table.SelectColumns(_, {"Language"})),
b = List.Transform({ 1..Table.ColumnCount(a) }, (x)=> "Language" & Text.From(x)),
c = List.Zip({ Table.ColumnNames(a), b }),
d = Table.RenameColumns(a, c)
][d], type table}}),
ExpandedAll = Table.RemoveColumns(Table.ExpandTableColumn(GroupedRows, "All", List.Transform({ 1..List.Max(GroupedRows[Count]) }, each "Language" & Text.From(_))), {"Count"})
in
ExpandedAll
Use this code. Replace your source appropriately
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"PersonID"}, {{"All", each Record.Combine({[PersonID = Table.FirstValue(_)]} & List.Transform({1..Table.RowCount(_)}, (i)=> Record.AddField([], "Language" & Text.From(i), _[Language]{i-1})))}})[[All]],
#"Expanded All" = Table.ExpandRecordColumn(#"Grouped Rows", "All", Record.FieldNames(Record.Combine(#"Grouped Rows"[All])))
in
#"Expanded All"
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 6 | |
| 6 | |
| 6 |