Forum Discussion

Nuuki's avatar
Nuuki
Regular Visitor
8 years ago
Solved

Only show relevant values in a slicer?

Hi,

 

I'm a newcomer to Power BI Desktop, having recently dipped my toe having previously done some basic work with Power Query. Most of that previous activity involved using Power Query primarily to load and trandform data, and the migration to using the data model and relationships is giving me some new options and challenges, as previously I was sticking with merging tables and using them in Excel. Here's a good example of a struggle I'm having...

 

 

So lets say I have a table consisting of restaurant dishes - this contains an ID, and then a bunch of information such as country of origin, calories, ingredients etc.

 

I then have a second table showing sales from a restaurant - that might include a unique order reference, as well as the recipe code, allowing it to be linked to the previous table - all easy so far.

 

So now I create a matix visualisation to present the sales data. I add some slicers to the sheet to let me filter the data as I want, and one of the slicers is for country or origin.

 

If I had merged the tables together and built my matrix from the resulting table, the slicer would only show me the relevant countries i.e. those that were actually represented in the orders list. However by building off the source tables through a relationship, I'm seeing every country listed that's in that recipes table. I can see why it would do that by default, but is there a way to only show the values in the that match a value in both tables?

 

This is obviously a made up example, but its coming up in a few areas so hopefully makes sense. Thanks in advance for any advice.

7 Replies