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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Transpose in visualization alone

Hi All,

 

I would like to have Column header to be displayed in First Column and its values to be displayed in second column.

 

rowswap.PNG

 

We can do transpose in Edit Queries but i want to change my visualization part alone.

 

Thanks in Advance

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Then you need first create a table ,and put all the column headers into one column,such as below:

 

Annotation 2020-01-28 114929.png

Then you need a measure as below:

 

 

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Address", SELECTEDVALUE ( 'Table (2)'[Address] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Amount", SELECTEDVALUE ( 'Table (2)'[Amount] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Country", SELECTEDVALUE ( 'Table (2)'[Country] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Gender", SELECTEDVALUE ( 'Table (2)'[Gender] )
)

 

Finally in the new table ,put column and measure into a matrix as below:

Annotation 2020-01-28 115149.png

And you will see:

 

Annotation 2020-01-28 115225.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly

View solution in original post

10 REPLIES 10
az38
Community Champion
Community Champion

Hi @Anonymous 

 

you can use the next technique with creating new calculated table. the exactly solution depends on your data model and aggregation business logic

 

Table2 = 
UNION(
    ROW("Field"; "Amount"; "Value"; SUM(Table1[Amount]));
    ROW("Field"; "Address"; "Value"; FIRSTNONBLANK('Table1'[Address];1));
    ROW("Field"; "Country"; "Value"; FIRSTNONBLANK('Table1'[Country];1))
)

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38 ,

 

I tried your suggestion but i am not getting it properly. Can you explain it in more detaild manner. I assume i am getting confused by the delimiters present in the code which you sent. ( ; , )

 

Thanks

az38
Community Champion
Community Champion

@Anonymous 

delimiter depends on your system localization settings.

you can just to replace ";" to "," in my statement

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38 ,

 

5.PNG

 

It is almost working but when i select anything in filter then because of firstnonblank function it is not assciating properly.

 

Thanks

amitchandak
Super User
Super User

In matrix visualization, you have the option Show on Row. That will move you measure on the row.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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

Hi @amitchandak ,

 

Can you explain in more detail on hoe to get that in matrix.

 

Original dataset

51.PNG

 

Expected Output

rowswap.PNG

Thanks

Hi @Anonymous ,

 

Go to "edit queries">select all columns>"Transform">"Unpivot columns":

 

11.png12.png13.png

Then choose "Use first row as headers":

14.png

 

Choose "close and apply",then you will see :

 

15.png

 

Best Regards,
Kelly

Anonymous
Not applicable

Hi @v-kelly-msft 

 

Thanks for your response but do we have any other way to do it without using Query editor and Edit Queries section. i.e., in front end itself or just creating a measure or calculated column?

 

Thanks

Hi @Anonymous ,

 

Then you need first create a table ,and put all the column headers into one column,such as below:

 

Annotation 2020-01-28 114929.png

Then you need a measure as below:

 

 

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Address", SELECTEDVALUE ( 'Table (2)'[Address] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Amount", SELECTEDVALUE ( 'Table (2)'[Amount] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Country", SELECTEDVALUE ( 'Table (2)'[Country] ),
    SELECTEDVALUE ( 'Table (4)'[Header] ) = "Gender", SELECTEDVALUE ( 'Table (2)'[Gender] )
)

 

Finally in the new table ,put column and measure into a matrix as below:

Annotation 2020-01-28 115149.png

And you will see:

 

Annotation 2020-01-28 115225.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly

Anonymous
Not applicable

Hi @v-kelly-msft ,

 

Let us assume out of these 4 column we have 1 as a measure then how to give that measure value?

 

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.