Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
durgaraop21
Helper II
Helper II

Power Query

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       
CodeMonth nameABCDEF
100janM11112131415
101janM22122232425
102febM33123242526
103febM14124252627
104marM25125262728
105marM16126272829
106aprilM37127282930
107aprilM58128293031
108janM79129303132
109febM910130313233
110marchM1111131323334

 

Expected Output Like this below:

durgaraop21_1-1686546750317.png

 

 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @durgaraop21 ,

According to your description, here's my solution.

1.Select columns from A to F, then click Unpivot Columns.

vyanjiangmsft_0-1687769922974.png

Result:

vyanjiangmsft_1-1687770050429.png

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.

vyanjiangmsft_2-1687770138412.png

In a matrix, put Code in Rows, Month name and Attribute in Columns, get the result:

vyanjiangmsft_3-1687770203271.png

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.

View solution in original post

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @durgaraop21 ,

According to your description, here's my solution.

1.Select columns from A to F, then click Unpivot Columns.

vyanjiangmsft_0-1687769922974.png

Result:

vyanjiangmsft_1-1687770050429.png

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.

vyanjiangmsft_2-1687770138412.png

In a matrix, put Code in Rows, Month name and Attribute in Columns, get the result:

vyanjiangmsft_3-1687770203271.png

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 .....

some_bih
Community Champion
Community Champion

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Community Champion
Community Champion

Hi @durgaraop21 in Excel pivot, just drop columns Months names and Product into Columns area. I hope this help





Did I answer your question? Mark my post as a solution!

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...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.