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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have the table in the below format
| EmplID | School | Degree | Major |
| 123 | S1 | D1 | M1 |
| 123 | S2 | D2 | M2 |
| 123 | S3 | D3 | M3 |
| 456 | S1 | D1 | M1 |
| 456 | S2 | D2 | M2 |
| 456 | S3 | D3 | M3 |
I would want to change it to,
| EmplID | School1 | Degree 1 | Major 1 | School2 | Degree 2 | Major 2 | School3 | Degree 3 | Major 3 |
| 123 | S1 | D1 | M1 | S2 | D2 | M2 | S3 | D3 | M3 |
| 456 | S1 | D1 | M1 | S2 | D2 | M2 | S3 | D3 | M3 |
Can someone suggest how we can achieve this in Power BI Desktop or using Query Editor?
Solved! Go to Solution.
Hi,
let
Source = YourSource,
Group = Table.Group(Source, {"EmplID"}, {{"Data", each Table.AddIndexColumn(_,"Index",1)}}),
Expand = Table.ExpandTableColumn(Group, "Data", {"School", "Degree", "Major", "Index"}, {"School", "Degree", "Major", "Index"}),
UnPivot = Table.UnpivotOtherColumns(Expand, {"EmplID", "Index"}, "Attribute", "Value"),
CombineColumns = Table.CombineColumns(Table.TransformColumnTypes(UnPivot, {{"Index", type text}}),{"Attribute", "Index"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Attribute.1"),
Pivot = Table.Pivot(CombineColumns, List.Distinct(CombineColumns[Attribute.1]), "Attribute.1", "Value")
in
Pivot
Stéphane
Hi,
let
Source = YourSource,
Group = Table.Group(Source, {"EmplID"}, {{"Data", each Table.AddIndexColumn(_,"Index",1)}}),
Expand = Table.ExpandTableColumn(Group, "Data", {"School", "Degree", "Major", "Index"}, {"School", "Degree", "Major", "Index"}),
UnPivot = Table.UnpivotOtherColumns(Expand, {"EmplID", "Index"}, "Attribute", "Value"),
CombineColumns = Table.CombineColumns(Table.TransformColumnTypes(UnPivot, {{"Index", type text}}),{"Attribute", "Index"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Attribute.1"),
Pivot = Table.Pivot(CombineColumns, List.Distinct(CombineColumns[Attribute.1]), "Attribute.1", "Value")
in
Pivot
Stéphane
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 12 | |
| 9 | |
| 7 | |
| 6 |