March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All, Can someone help me with Pivote, I know there is a sequence for transpose/pivote/unpivot to have a single row.
example:
Data | |||||||
Code | Month name | A | B | C | D | E | F |
100 | jan | M1 | 11 | 12 | 13 | 14 | 15 |
101 | jan | M2 | 21 | 22 | 23 | 24 | 25 |
102 | feb | M3 | 31 | 23 | 24 | 25 | 26 |
103 | feb | M1 | 41 | 24 | 25 | 26 | 27 |
104 | mar | M2 | 51 | 25 | 26 | 27 | 28 |
105 | mar | M1 | 61 | 26 | 27 | 28 | 29 |
106 | april | M3 | 71 | 27 | 28 | 29 | 30 |
107 | april | M5 | 81 | 28 | 29 | 30 | 31 |
108 | jan | M7 | 91 | 29 | 30 | 31 | 32 |
109 | feb | M9 | 101 | 30 | 31 | 32 | 33 |
110 | march | M11 | 111 | 31 | 32 | 33 | 34 |
Expected Output Like this below:
Solved! Go to Solution.
Hi @durgaraop21 ,
According to your description, here's my solution.
1.Select columns from A to F, then click Unpivot Columns.
Result:
2. To sort the month name column, add a custom column:
if [Month name]="jan" then 1 else if [Month name]="feb" then 2 else if [Month name]="mar" then 3 else if [Month name]="april" then 4 else 5
Sort Month name column by MonthNo column.
In a matrix, put Code in Rows, Month name and Attribute in Columns, get the result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @durgaraop21 ,
According to your description, here's my solution.
1.Select columns from A to F, then click Unpivot Columns.
Result:
2. To sort the month name column, add a custom column:
if [Month name]="jan" then 1 else if [Month name]="feb" then 2 else if [Month name]="mar" then 3 else if [Month name]="april" then 4 else 5
Sort Month name column by MonthNo column.
In a matrix, put Code in Rows, Month name and Attribute in Columns, get the result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks For your help .....
Hi @durgaraop21 I do not understand your request. After creation of PQ transformation your output could be pivot table and then do as I described.
Proud to be a Super User!
Hi @durgaraop21 in Excel pivot, just drop columns Months names and Product into Columns area. I hope this help
Proud to be a Super User!
Hi @some_bih , Thanks for the reply, Only we use Power Query Editor,,......i am giving some example data in excel...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.