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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power Query Unpivot help!

Hi there,

 

I have data which I need to unpivot as shown below:

 

UNPIVOT HELP.PNG
Please note there are many customers and attibutes, so I don't want to split into seperate queries! is it possible within a single query?

 

Thank You so much!

 

Alex

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , refer if this blog can help

https://kohera.be/blog/power-bi/how-to-unpivot-twice/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

TomMartens
Super User
Super User

Hey @Anonymous 

 

to achieve what you want, you need three steps.

This is how my sample data looks like

image.png

First step, unpivot the columns CA-A1 - CX-AX then your table will look like this:

image.png

Second Step - Split the column Attribute in 2 columns:

image.png

select the proper delimiter, maybe it's " - " on your data, here it's just the dash, after that your data will look like this:

image.png

Third step
Mark the column that contains all the attributes, here its Attribute.2 and Pivot the column, choose Value column for the values:

image.png

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey @Anonymous 

 

to achieve what you want, you need three steps.

This is how my sample data looks like

image.png

First step, unpivot the columns CA-A1 - CX-AX then your table will look like this:

image.png

Second Step - Split the column Attribute in 2 columns:

image.png

select the proper delimiter, maybe it's " - " on your data, here it's just the dash, after that your data will look like this:

image.png

Third step
Mark the column that contains all the attributes, here its Attribute.2 and Pivot the column, choose Value column for the values:

image.png

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
amitchandak
Super User
Super User

@Anonymous , refer if this blog can help

https://kohera.be/blog/power-bi/how-to-unpivot-twice/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you I was able to solve my problem with the help of this link! 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.