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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
wherdzik
Helper III
Helper III

Pivoting Two Columns, Is it Possible?

I want to Pivot Item Types but for ItemFTE and ProratedSalaryAllocation.  I can only do one of those columns but not both.

Is that even possible?

 

wherdzik_0-1706053799718.png

 

This is the only way I am able to do it, It wont let me bring in the ProratedSalaryAllocation colum.  

 

wherdzik_1-1706053924556.png

 

I want the end result to look something like this.

wherdzik_0-1706054147006.png

 

 

Thanks for your help.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @wherdzik ,

Consider grouping and then unpivot column before transposing.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7JzMtMTsxR0lEyBGJjA1NDS6VYHQwJQwMzQ3NzdBkDPTMgaWRsaIlDysLc2MwAhy5MCZBFpiYWZqZYXWBpZmxhhmmWOcgsS3NDiGn+JRmpRQq6Cp55JalFeVAlBqYgNYZGRriVgGwwMTIxAasISi1OTSxKzgAqcq3AaQ4uVQijYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ItemType = _t, ItemFTE = _t, ProratedSalaryAllocation = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ItemType", type text}, {"ItemFTE", type number}, {"ProratedSalaryAllocation", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ItemType"}, {{"ItemFTE", each List.Sum([ItemFTE]), type nullable number}, {"ProratedSalaryAllocation", each List.Sum([ProratedSalaryAllocation]), type nullable number}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Grouped Rows", {"ItemType"}, "Attribute", "Value"),
    #"Transposed Table" = Table.Transpose(#"Unpivoted Columns")
in
    #"Transposed Table"

vcgaomsft_0-1706060736061.png

And the output:

vcgaomsft_1-1706060767374.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @wherdzik ,

Consider grouping and then unpivot column before transposing.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7JzMtMTsxR0lEyBGJjA1NDS6VYHQwJQwMzQ3NzdBkDPTMgaWRsaIlDysLc2MwAhy5MCZBFpiYWZqZYXWBpZmxhhmmWOcgsS3NDiGn+JRmpRQq6Cp55JalFeVAlBqYgNYZGRriVgGwwMTIxAasISi1OTSxKzgAqcq3AaQ4uVQijYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ItemType = _t, ItemFTE = _t, ProratedSalaryAllocation = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ItemType", type text}, {"ItemFTE", type number}, {"ProratedSalaryAllocation", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ItemType"}, {{"ItemFTE", each List.Sum([ItemFTE]), type nullable number}, {"ProratedSalaryAllocation", each List.Sum([ProratedSalaryAllocation]), type nullable number}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Grouped Rows", {"ItemType"}, "Attribute", "Value"),
    #"Transposed Table" = Table.Transpose(#"Unpivoted Columns")
in
    #"Transposed Table"

vcgaomsft_0-1706060736061.png

And the output:

vcgaomsft_1-1706060767374.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

spinfuzer
Solution Sage
Solution Sage

Merge the Columns by delimiter and then Pivot the Merged Column and Do Not Aggregate.  Split by Delimiter after the Pivot.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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