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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
msc7808
Regular Visitor

Data Import and unPivot

Hi There

 

I am new to PowerBI. My source data is sample sales breakdown of various categories. 

 

msc7808_0-1645394258018.png

 

I would like to unpivot and organize information vertically. Given few tries but didn't have success so far.

 

msc7808_1-1645394390557.png

 

Can someone please share their insight into this?

 

Thanks


Manny

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep=#table({"ID","Category","Quantity"},List.TransformMany(Table.ToRows(PreviousStep),each List.Split(List.Skip(_),2),(x,y)=>{x{0}}&y))

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @msc7808 

 

Daniel has provided a perfect solution. You can copy his code into Advanced Editor to add a new step and replace "PreviousStep" with the last step name in your APPLIED STEPS pane like #"Changed Type". 

How to add a step or steps to an existing power query - YouTube

 

Best Regards,
Community Support Team _ Jing

wdx223_Daniel
Super User
Super User

NewStep=#table({"ID","Category","Quantity"},List.TransformMany(Table.ToRows(PreviousStep),each List.Split(List.Skip(_),2),(x,y)=>{x{0}}&y))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors