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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Avichai_ka
Regular Visitor

Pivot\Unpivot

I have table with a few columns, I filter to specific Order for the purpose of the example, 

Avichai_ka_0-1695126906402.png

I want to show 1 row for all orders that all type paper get his QTY .

sometimes I have 3/4/5... types paper 

 

I try this : 

Avichai_ka_1-1695127195111.png

 

Avichai_ka_3-1695127227299.png

 

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

Hi @Avichai_ka ,

 

mussaenda_0-1695192200527.png

 

This might not be the most elegant way to achieve what you need. But have a check on this for the idea

View solution in original post

7 REPLIES 7
mussaenda
Super User
Super User

Hi @Avichai_ka ,

 

mussaenda_0-1695192200527.png

 

This might not be the most elegant way to achieve what you need. But have a check on this for the idea

wow!!!
This is working, I try now to remove "WHERE" for to be dinamic

wdx223_Daniel
Super User
Super User

NewStep=Table.Combine(Table.Group(YourTableInPhoto1,"Order/Line",{"n",each #table(List.RemoveLastN(Table.ColumnNames(_),2)&List.TransformMany({1..Table.RowCount(_)/2},each {"Paper","QTY"},(x,y)=>y&"_"&Number.From(x)),{List.RemoveLastN(Record.ToList(_{0}),2)&List.Combine(Table.ToRow([[Attribute],[Value]]))})})[n])

Hi, tnx. 
Can you explain step by step please? I can't copy-past M code as it is.

Sorry, I want to understand the process

Avichai_ka
Regular Visitor

Hi , 
I want to display for every order 1 row .
From source table (photo 1) I want to get :

Avichai_ka_0-1695184136291.png

Thank you

christinepayton
Super User
Super User

It looks like you are unpivoting and then re-pivoting - usually you would only do one of the two at a time, what are you trying to accomplish exactly?

AbhinavJoshi
Responsive Resident
Responsive Resident

Hi @Avichai_ka . To understand your question better, you would like the paper types as the row? Or can you share one sample output you are expecting. Thanks

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.