Forum Discussion
Filter From Dimension Table
Hello,
I have a fact table, Sales, which contains a two-digit country code, but not the actual country name. I added and linked a CountryCode dimension table, which includes the country code and corresponding Country Name. I need users to be able to filter Sales data on the Country Name.
We only have sales in a handful of countries and I only want the country names, that have sales, to show up in the slicer/filter.
If I create the CountryCode table with all 240 countries, as I've done in the example below, all 240 countries show up in the slicer. This is not desireable. On the other hand, if I create the CountryCode table to contain only countries with sales, this creates a maintenance issue (i.e. as sales are made in the new countries in the future, I'd need to check and manual add the new countries to the CountryCode table). How can I create a filter, referencing CountryName values from the CountryCode table, which only shows CountryNames for that have sales and which will act dynamically to also show new CountryNames in the future when those countries have sales data.
If it's not something you want done at the model level and only done for a single slicer, you can add a measure as a filter to an individual visual. What you would do is add in your "Sales Count" measure to the visual level filter for your slicer and set it to "is not blank".
2 Replies
- Alex_SawdoResolver II
If it's not something you want done at the model level and only done for a single slicer, you can add a measure as a filter to an individual visual. What you would do is add in your "Sales Count" measure to the visual level filter for your slicer and set it to "is not blank".
- AnonymousNot applicable
Worked beautifully. Thanks!