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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
evvvb7
Frequent Visitor

Creating a new table help

Hello! Please help - I have a situation where my data source has 1 row of sales data and separate columns identifying the the types of product. The issue is I need to display analytics based on the Product Type summarizing the Amount of each Product Type sold. I need to create a new table, I beleive, to achieve this so Product Type is in a singular column, so that there is multiple rows for each sale #, one for each Product Type. Such as transforming this sample data:

 

Sale #AmountProduct AProduct  BProduct CProduct D
1200,000YesNoNoNo
215,000NoYesYesNo
322,000YesNoYesYes

 

To this:

 

Sale #AmountProduct Type
1200,000Product A
215,000Product B
215,000Product C
322,000Product A
322,000Product C
322,000Product D
3 ACCEPTED SOLUTIONS
kpost
Super User
Super User

-Click"Transform Data" to open Power Query and modify the table

 

-Highlight the first two columns "Sale #" and "Amount", then right click and select "Unpivot other columns"

 

- Filter the "Yes/No" column on the "Yes" value.

 

See below screenshot, and I have also attached a .pbix file where I solved your problem.

solution.PNG

///Mediocre Power BI Advice, but it's free///

View solution in original post

Yes, if you want to keep the original dataset untouched, then BEFORE you do the steps I outlined, duplicate the original table.  Make your modifications to the duplicate.

duplicate.PNG

View solution in original post

Assuming you want to have two copies of this table in your dataset, namely the original and the transformed one per your question:

 

Add the table to your dataset, Duplicate it, do the transformations I described in the Solution on the duplicated version.

 

This will leave you with two copies of the table.  One transformed per your question, and the other left untouched.  Both will query the original source, and both will update when the source document is updated and you refresh your dataset.

View solution in original post

8 REPLIES 8
kpost
Super User
Super User

-Click"Transform Data" to open Power Query and modify the table

 

-Highlight the first two columns "Sale #" and "Amount", then right click and select "Unpivot other columns"

 

- Filter the "Yes/No" column on the "Yes" value.

 

See below screenshot, and I have also attached a .pbix file where I solved your problem.

solution.PNG

///Mediocre Power BI Advice, but it's free///

evvvb7
Frequent Visitor

Thank you! This certainly does what i was looking for.

 

Is there a way of doing this without changing the original dataset? Such as creating a table rather than overriding the table? Perhaps as a query so when data is updated it automatically updates?

Yes, if you want to keep the original dataset untouched, then BEFORE you do the steps I outlined, duplicate the original table.  Make your modifications to the duplicate.

duplicate.PNG

evvvb7
Frequent Visitor

Thanks for providing more insight and apologies for delay on my response (weekend)...

 

Is there a way I could have the "unpivot columns" do its things upon updating a dataset? If the underlying data gets refreshed, this unpivot function automatically updates the new table we created for this scenario? Would it be a query as opposed a table creation?

Anything you do in Power Query will automatically be executed when you update the dataset.  It's baked into the 'refresh'.

 

In the case of a 'Duplicate' operation in Power Query, I believe the first step for both tables is to query the original source before doing any transformations.

evvvb7
Frequent Visitor

So query the first table, and then do the unpivot columns off the querried table?

Assuming you want to have two copies of this table in your dataset, namely the original and the transformed one per your question:

 

Add the table to your dataset, Duplicate it, do the transformations I described in the Solution on the duplicated version.

 

This will leave you with two copies of the table.  One transformed per your question, and the other left untouched.  Both will query the original source, and both will update when the source document is updated and you refresh your dataset.

evvvb7
Frequent Visitor

Awesome, thanks for your expertise!

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors