Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transpose table in report visual in Power BI Desktop

Tags:

powerbi

dax

This is how my table looks like in Power BI Desktop:

enter image description here

In the 1st column, we have the year, and in the n remaining columns the indicators.

I'd like to build a matrix visual with the indicators in the rows and years in columns.

Now, I know I can unpivot all the columns except the year in the query editor. But the structure above is necessary to build charts where the x-axis is the year and the series is only one or two indicators.

Is there a way (a measure, calculated table or other) to build the matrix I need?

Thanks!


1 Answers

If I understand correctly, you want both your original table layout and a new transposed table like this: enter image description here

You can do that with a new, additional query. Just go into your query editor and right click on your existing query (in the left pane of the screen), and then click Reference. That will create a new query, using the previously existing query as its source.

Then click the Transform tab. Then click the bottom part of the "Use First Row As Headers" button, so that you can then click on "Use Headers as First Row".

enter image description here

Then click on Transpose.

Then click on the top part of the "Use First Row As Headers" button (or click on its bottom part and then "Use First Row As Headers")

Then click on the Home tab and "Close & Apply". This will add a new table to your Power BI data set, from the transposed table.

like image 131
Marc Pincince Avatar answered Oct 30 '25 16:10

Marc Pincince



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!