Forum Discussion
Unpivot or Swap rows/columns while keeping DAX formulas
I have the following data, with quite a few working DAX calculated columns that produces the following type of table (years of data and calculations essentially):
What I wish I could easily do is just swap this exact table's columns and rows, so that the same data (and all my DAX calculations) will stay as they are but instead display Years along the top and the other values as row labels? Like so:
| Value | 2018 | 2019 | 2020 |
| Capital Contributions | 3000 | 3500 | 2700 |
| Ordinary Income | 2000 | 0 | 300 |
| Subtotal | 5000 | 3500 | 3000 |
I am so far unable to figure out how to easily do this in a matrix. Any ideas?
mhomol you can use a matrix visual, add the year on columns, and measures on values, and in the format pane, turn on "Show on Rows"
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
2 Replies
- parry2k
Super User
mhomol you can use a matrix visual, add the year on columns, and measures on values, and in the format pane, turn on "Show on Rows"
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- mhomol
Helper I
Holy crap thank you!!!!