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

HOW TO TRANSFORM columns into row using power query ?

Hi Team,

 

Can you please help me on power query to transformation?

 

Input

rgv_538_0-1635405866168.png

 

same input was loaded into the power bi file and link is attached in the below

Reference power bi File:  https://1drv.ms/u/s!Au-aOkl1BoHuhwcy-cGvuQhVMj6-?e=LSc2U2

 

Output

rgv_538_1-1635406366476.png

 

 

 

Please let me know if you need any more information

Thanks In advance

RGV

 

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Custom1 = Table.UnpivotOtherColumns(Table.Skip(Table.PromoteHeaders(Table.Skip(Table.Transpose(Table.CombineColumns(Table.Transpose(Source),{"Column2","Column3"},each if _{0}=null or _{0}="" then "Country" else Text.Combine(_,"-"),"n"))))),{"Country"},"Date","Actual")
in
    Custom1

wdx223_Daniel_0-1635411768496.png

 

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Custom1 = Table.UnpivotOtherColumns(Table.Skip(Table.PromoteHeaders(Table.Skip(Table.Transpose(Table.CombineColumns(Table.Transpose(Source),{"Column2","Column3"},each if _{0}=null or _{0}="" then "Country" else Text.Combine(_,"-"),"n"))))),{"Country"},"Date","Actual")
in
    Custom1

wdx223_Daniel_0-1635411768496.png

 

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.