Forum Discussion
pivot data
hello,
I am new to powerbi. I have tried to use my data below to pivot to my desired output and i am struggling and it is not working. Any help will be definitely helpful to me.
| period | Category A | Category B | Category C |
| Jan-15 | 2 | 22 | 23 |
| Feb-15 | 3 | 55 | 67 |
| Mar-15 | 2 | 66 | 99 |
| Apr-15 | 1 | 44 | 22 |
| May-15 | 4 | 67 | 33 |
| Jun-15 | 5 | 45 | 34 |
DESIRED OUTPUT
| period | Jan-15 | Feb-15 | Mar-15 | Apr-15 | May-15 | Jun-15 |
| Category A | 2 | 3 | 2 | 1 | 4 | 5 |
| Category B | 22 | 55 | 66 | 44 | 67 | 45 |
| Category C | 23 | 67 | 99 | 22 | 33 | 34 |
THANK you!!!
- Anonymous9 years ago
In the query editor, select your Period column and hit Unpivot Other Columns. Then select Period again and hit Pivot Column. Value should be the Values column, then open the advanced options and change it to Don't Aggregate.
I would only select Period and Upivot Other Columns
Then create a Matrix place Period in Columns, Category (Attribute) in Rows and Value in Values
The data will remain in better shape for analysis than your final desired output but you'll still be able to achieve it :smileyhappy:
5 Replies
- AnonymousNot applicable
In the query editor, select your Period column and hit Unpivot Other Columns. Then select Period again and hit Pivot Column. Value should be the Values column, then open the advanced options and change it to Don't Aggregate.
- SeanCommunity Champion
I would only select Period and Upivot Other Columns
Then create a Matrix place Period in Columns, Category (Attribute) in Rows and Value in Values
The data will remain in better shape for analysis than your final desired output but you'll still be able to achieve it :smileyhappy:
- AnonymousNot applicable
Seanusually I'm the one who tells people they should use a different method instead of just telling them how to get the thing they asked for. :smileylol: