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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dcech7
Regular Visitor

Product Filter Across Multiple Columns For Single Sale

Hello,

 

I am new to powerBI and I'm running into an issue my data looks something like this

 

Deployment IDApproval StatusCountryProduct DetailsSales OutForecasted UnitsProduct Details #2Sales Out #2Forecasted Units #2Product Details #3Sales Out #3Forecasted Units #3
1ApprovedUSAApple12Orange24Apple46
2ApprovedGermanyOrange45Lemon44Kiwi26
3ApprovedGermanyLemon55Kiwi2 2Orange15

 

My issue is that when I try to filter by Product Details and choose Apples, it doesn't pick up apples in Product Details #3. My hope is that I can analyze sales for each product in respect to other filters like country, ie "What is the Distribution of units in germany by product name." 

 

Anything helps thank you. Please reply if more clarification is needed. 

1 ACCEPTED SOLUTION

The best approach is to reshape the data. You should have 1 column for product, 1 for sales out, 1 for forecast. Add a column for details, like #1, #2 etc if needed. You can do this with Power Query, but I can't say how without seeing the data. My guess is unpivot columns other than the first 3, remove the references to #1, #2 etc so all data has the same column names, then repivot the columns. That will combine all into the same column



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

3 REPLIES 3

The best approach is to reshape the data. You should have 1 column for product, 1 for sales out, 1 for forecast. Add a column for details, like #1, #2 etc if needed. You can do this with Power Query, but I can't say how without seeing the data. My guess is unpivot columns other than the first 3, remove the references to #1, #2 etc so all data has the same column names, then repivot the columns. That will combine all into the same column



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Hi Matt,

 

Thanks for the reply. My only issue with reshaping the data would be maintaining the integrity of future data that comes in. Would I need to transform the data every time we have an update or would Power Bi be able to pick up the pattern? Anyways thanks for the advice I can definitely try to do that. 

 

 

Well, it does depend on what can change, but if you follow my recipe by unpivoting other columns, it will correlctly handle new sets of columns. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors