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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Create a custom table duplicating rows from another table based on the other table's headers

Hi, I'm asking for help creating a custom table which creates multiple rows out of each original row in my PowerBI dataset. Please excuse me if this has already been answered.

 

The scenario:

 

I imported an excel file into my project with this table (let's name it "Customers"):

 

CustomerBoughtInStoreBoughtOnlineBoughtByReferral
BobYY 
JaneYYY
JennyY  

 

Without leaving PowerBI and creating external excel files, I want to create a new query or table (not a measure) in my project which looks like this:

 

CustomerStage
BobBoughtInStore
BobBoughtOnline
JaneBoughtInStore
JaneBoughtOnline
JaneBoughtByReferral
JennyBoughtInStore

 

My new table will create a row for each customer and for each stage that they've been marked in the original Customers tables.

 

How can I acheve this?

 

Thank you in advance!

1 ACCEPTED SOLUTION
ebeery
Solution Sage
Solution Sage

@Anonymous this can be easily achieved using the "Unpivot" transformation in Power Query.

After importing your table, select the "Customer" column, and from the Transform tab, select "Unpivot Columns" >> "Unpivot Other Columns".

ebeery_0-1653356150645.png


Then, filter the "Value" column to keep only "Y", and finally, remove the Value column.

ebeery_1-1653356199111.png

 

ebeery_3-1653356211958.png

 

ebeery_4-1653356223016.png

 

View solution in original post

2 REPLIES 2
ebeery
Solution Sage
Solution Sage

@Anonymous this can be easily achieved using the "Unpivot" transformation in Power Query.

After importing your table, select the "Customer" column, and from the Transform tab, select "Unpivot Columns" >> "Unpivot Other Columns".

ebeery_0-1653356150645.png


Then, filter the "Value" column to keep only "Y", and finally, remove the Value column.

ebeery_1-1653356199111.png

 

ebeery_3-1653356211958.png

 

ebeery_4-1653356223016.png

 

Anonymous
Not applicable

Amazing, this is exactly what I needed. Thank you very much!

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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