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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Power Query - How to transform data with Pivot function for multiple columns

Hi,

 

I would like to perform a data transformation in Power Query with the pivot function.

Below is an example of what I want to achieve.

 

ORIGINAL DATA

image.png

 

FINAL DATA I WANT TO GET

image.png

 

column3 = unique key that I want to retain in the table without duplicates

column4 = attribute column that I want to "pivot" from rows into several new columns as header

column 5 & 6 = value column from the original unpivoted column and distributed as values to the corresponding new columns

 

I have already tested the pivot function in Power Query but that seems not work with multiple value columns (column 5 & 6).

Anyone can suggest how to achieve the above result in Power Query?

Thanks!

 

Best regards,

Emily

 

2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

Please check the attached file below my signature and let me know if it works as expected.

Fowmy_0-1621943849036.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

Anonymous
Not applicable

@Fowmy Many thanks for sharing the sample solution file!

I've tested it in my real business report and fine-tune some of the M codings based on business requirement, it works well with the expected result.

Thank you so much for your quick reply and have a great day!

 

Best regards,

Emily

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Please check the attached file below my signature and let me know if it works as expected.

Fowmy_0-1621943849036.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy Many thanks for sharing the sample solution file!

I've tested it in my real business report and fine-tune some of the M codings based on business requirement, it works well with the expected result.

Thank you so much for your quick reply and have a great day!

 

Best regards,

Emily

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.