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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors