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

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.

Reply
Anonymous
Not applicable

Pivoting error in power query

Hi Experts,

How can we achieve below pivoting in Power Query or close to this?

Please help?

 

SonaSinghA_0-1671439302155.png

 

Getting below error due to duplicate records for User 1, but values are different fpr this user.

Please help

SonaSinghA_1-1671439348956.png

 

1 ACCEPTED SOLUTION
grandtotal
Resolver III
Resolver III

You can try List.Distinct function as aggregation (not available through the UI):

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0ABKOjiCWUqwOspgTkDBCEwOpMwGLGaHrjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [User = _t, Template = _t, Title = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Title]), "Title", "Value", List.Distinct),
#"Expanded AA" = Table.ExpandListColumn(#"Pivoted Column", "AA"),
#"Expanded AB" = Table.ExpandListColumn(#"Expanded AA", "AB")
in
#"Expanded AB"

Not perfect but maybe you can use it.

grandtotal_1-1671496877756.png

 

View solution in original post

3 REPLIES 3
grandtotal
Resolver III
Resolver III

You can try List.Distinct function as aggregation (not available through the UI):

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0ABKOjiCWUqwOspgTkDBCEwOpMwGLGaHrjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [User = _t, Template = _t, Title = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Title]), "Title", "Value", List.Distinct),
#"Expanded AA" = Table.ExpandListColumn(#"Pivoted Column", "AA"),
#"Expanded AB" = Table.ExpandListColumn(#"Expanded AA", "AB")
in
#"Expanded AB"

Not perfect but maybe you can use it.

grandtotal_1-1671496877756.png

 

Anonymous
Not applicable

Aggeregation is not required , I need data in seperate rows for User 1

Idrissshatila
Super User
Super User

Hello,

 

you Should click on both columns title and value => then you click on the transforming tab => then click on pivot column and you should see the result as per the screenshot below

 

Idrissshatila_0-1671440129865.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos!



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors