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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
My input data has Years and month date as a column header. Can I transpose it into rows?
To illustrate my data has the following form:
| Customer | Product | 2018.01 | 2018.02 |
| Customer A | Product 1 | 1 | 2 |
| Customer A | Product 2 | 3 | 4 |
| Customer B | Product 1 | 5 | 6 |
| Customer B | Product 2 | 7 | 8 |
and I would like to get:
| Customer | Product | Time | Sales |
| Customer A | Product 1 | 2018.01 | 1 |
| Customer A | Product 2 | 2018.01 | 3 |
| Customer B | Product 1 | 2018.01 | 5 |
| Customer B | Product 2 | 2018.01 | 7 |
| Customer A | Product 1 | 2018.02 | 2 |
| Customer A | Product 2 | 2018.02 | 4 |
| Customer B | Product 1 | 2018.02 | 6 |
| Customer B | Product 2 | 2018.02 | 8 |
Is it possible?
Solved! Go to Solution.
Hi maati1980,
To achieve your requirement, click Query Editor-> Transform-> click on colunm [2018.01] and [2018.02] -> Unpivot Columns, then rename "attribute" and "value" to "Time" and "Sales".
Regards,
Jimmy Tao
You would unpivot those columns. The best way would be to select your first two columns and then "Unpivot other columns".
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 39 | |
| 34 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 122 | |
| 111 | |
| 83 | |
| 69 | |
| 68 |