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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
MORDax
Frequent Visitor

Make row values as Header

MORDax_0-1652834750394.png


This is the type of data I have but I want it to show like the following: 

MORDax_1-1652834788004.png

 


How do I acheive this?

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @MORDax ,

You can use the Table.Pivot function in Power Query to achieve what you want. Here's sample M Script that shows this capability.

danextian_1-1652835934150.png

 

danextian_0-1652835910279.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRCkktLklNATIMDPWByMjAyEgpVgcmG5Wfh1syIDE5G7usIYrBRlhk4QZjk0QYjC5rhNdgI3wGG+EyOBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Col A" = _t, #"Col B" = _t, #"Col C" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col A", Int64.Type}, {"Col B", type text}, {"Col C", type date}}),
    Custom1 = Table.Pivot(#"Changed Type", {"Tested", "Zoned", "Packed"}, "Col B", "Col C")
in
    Custom1

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
mahenkj2
Solution Sage
Solution Sage

Hi @MORDax ,

It should be easy to implement a pivot.

Better that you paste the data as table instead of image, so we can just exactly copy and paste and test. If I try with manually creating data, its working fine.

Ashish_Mathur
Super User
Super User

It works just fine

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, click on any cell in the second column and click on Transform > Pivot.  The rest of it should be easy for your to figure out.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

MORDax_0-1652889592178.png



It is coming up as this, not in one line 😕

danextian
Super User
Super User

Hi @MORDax ,

You can use the Table.Pivot function in Power Query to achieve what you want. Here's sample M Script that shows this capability.

danextian_1-1652835934150.png

 

danextian_0-1652835910279.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRCkktLklNATIMDPWByMjAyEgpVgcmG5Wfh1syIDE5G7usIYrBRlhk4QZjk0QYjC5rhNdgI3wGG+EyOBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Col A" = _t, #"Col B" = _t, #"Col C" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col A", Int64.Type}, {"Col B", type text}, {"Col C", type date}}),
    Custom1 = Table.Pivot(#"Changed Type", {"Tested", "Zoned", "Packed"}, "Col B", "Col C")
in
    Custom1

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

MORDax_1-1652889620514.png

For me, it is showing up as this.

I selected the second column and clicked Pivot column and selected Col C (original table) as Values Column (Don't Aggregate) but it is showing these null values and not appearing in one row. Please advise

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.