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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Experts,
How can we achieve below pivoting in Power Query or close to this?
Please help?
| User | Category | Template ID | Title | Document ID | ||
| 1 | AX | 10 | AA | 94237 | ||
| 1 | AX | 10 | AB | 94237 | ||
| 1 | AX | 10 | AC | 94237 | ||
| 2 | AX | 10 | AA | 94000 | ||
| Output | ||||||
| User | Category | Template ID | Title1 | Title2 | Title3 | Document ID |
| 1 | AX | 10 | AA | AB | AC | 94237 |
| 2 | AX | 10 | AA | 94200 |
Solved! Go to Solution.
Try this one, copy to Advanced editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXKMABKGBiCWI5CwNDEyNleK1cGQdMIn6YwiaYTNWAMDA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [User = _t, Category = _t, #"Template ID" = _t, Title = _t, #"Document ID" = _t]),
#"Duplicated Column1" = Table.DuplicateColumn(Source, "Title", "Title - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column1", List.Distinct(#"Duplicated Column1"[Title]), "Title", "Title - Copy")
in
#"Pivoted Column"
The trick is to duplicate Title column and then Pivot:
Result:
I hope this will help you.
Try this one, copy to Advanced editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXKMABKGBiCWI5CwNDEyNleK1cGQdMIn6YwiaYTNWAMDA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [User = _t, Category = _t, #"Template ID" = _t, Title = _t, #"Document ID" = _t]),
#"Duplicated Column1" = Table.DuplicateColumn(Source, "Title", "Title - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column1", List.Distinct(#"Duplicated Column1"[Title]), "Title", "Title - Copy")
in
#"Pivoted Column"
The trick is to duplicate Title column and then Pivot:
Result:
I hope this will help you.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 81 | |
| 65 | |
| 50 | |
| 45 |