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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ROG
Responsive Resident
Responsive Resident

Values from row needs to be as column headers.

Hey folks,

 

Can you please tell me how can I have the values from the Metrics column as column headers with the values from the value column under of this new colum.

I've tried unpivot and transpose, but I'm clear missing something as I can't get this right.

 

Expected output from the second photo.

 

ROG_0-1663091823625.png

 

 

ROG_1-1663092287731.png

 

Thank you.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @ROG ;

You could pivot in power query. select [Metric] and [Value] column ->pivot column.

vyalanwumsft_0-1663135028968.pngvyalanwumsft_1-1663135049103.png

The final show:

vyalanwumsft_2-1663135097001.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQ11DVS0lHy83EBkgH5xSUFiSlAln9Bal5mukJSYnEqkGdooBSrA1ZvpGusawYUcXENBZIFiZUgxc45+cWZeXDVRkiqLXWBeoHK/bwRyh3LUovSU2GqjYGqYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, #"Country Code" = _t, #"Country  Category" = _t, Metric = _t, value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Country Code", type text}, {"Country  Category", type text}, {"Metric", type text}, {"value", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Metric]), "Metric", "value")
in
    #"Pivoted Column"


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @ROG ;

You could pivot in power query. select [Metric] and [Value] column ->pivot column.

vyalanwumsft_0-1663135028968.pngvyalanwumsft_1-1663135049103.png

The final show:

vyalanwumsft_2-1663135097001.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQ11DVS0lHy83EBkgH5xSUFiSlAln9Bal5mukJSYnEqkGdooBSrA1ZvpGusawYUcXENBZIFiZUgxc45+cWZeXDVRkiqLXWBeoHK/bwRyh3LUovSU2GqjYGqYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, #"Country Code" = _t, #"Country  Category" = _t, Metric = _t, value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Country Code", type text}, {"Country  Category", type text}, {"Metric", type text}, {"value", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Metric]), "Metric", "value")
in
    #"Pivoted Column"


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks a lot!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors