This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is now in read-only for platform upgrade. Learn more
I'm sure this has been asked, but I'm still struggling to make the data pivot in the way that I want it to.
I have a query connected to Power BI with data pulling back by week since 2016, like the following:
Year Week Sales Inventory
2016 1 100 200
2016 2 104 208
....
2017 1 132 294
2017 2 88 105
........
I'd like to be able to pivot the table to line up like this:
Week 2016 Sales 2017 Sales 2016 Inventory 2017 Inventory
1 100 132 200 294
2 104 88 208 105
Anyone have advice?
Solved! Go to Solution.
In the Query Editor...
1) Unpivot Sales & Inventory
2) Merge Year and Atrribute
3) Pivot the Merged Column (Don't Aggregate)
As shown here...
Hope this helps! ![]()
In the Query Editor...
1) Unpivot Sales & Inventory
2) Merge Year and Atrribute
3) Pivot the Merged Column (Don't Aggregate)
As shown here...
Hope this helps! ![]()
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 23 | |
| 22 | |
| 14 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 47 | |
| 39 | |
| 24 | |
| 22 | |
| 20 |