Forum Discussion
Filtering Multiple Visuals with Different Filter Criteria
- 1 year ago
Hi tomperro
You can create measures that are filtered, using calculate dax function...
like :
KPI1 = Calculate (sum('table'[something]),filter('table'[Last Name = "Jones"])
This measure will return filtered result.If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- 1 year ago
This is all we have ....
Filters / Slicers or filter inside measures..If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thank you for your reply.
I am actually looking to do something different than what you explained.
I have 3 KPIs on one page.
All 3 KPIs are getting data from the same tables, but each KPI has different visualization filters.
What I am trying to do is store the different set of filters for each KPI somewhere so I do not have to keep adding filters to each visualization.
Can I store filters in a table or in a measure?
Example:
KPI 1 Filters = Last Name = "Jones"
KPI 2 Filters = Last Name = "Smith"
KPI 3 Filters = Last Name = "Jackson"
OR
Filter Table
| KPI | Filter |
| 1 | Last Name = "Jones" |
| 2 | Last Name = "Smith" |
| 3 | Last Name = "Jackson" |
Hi tomperro
You can create measures that are filtered, using calculate dax function...
like :
KPI1 = Calculate (sum('table'[something]),filter('table'[Last Name = "Jones"])
This measure will return filtered result.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- tomperro1 year agoHelper V
Can the filters be saved in a table?
This way, if I ever need to update the filter, i only have to modify them in the table rather than every measure that might have the filters.
- Ritaf19831 year agoSuper User
The measures are not part of the table; they are not "active" unless they are in a visualization. Technically, this is an advantage because it saves on model size.At the same time, in terms of functionality, this approach does meet your needs. If you want to make changes, you simply update the measure. From the user's perspective, there is no need to change anything, as what will appear in the visualization is your measure, which remains consistent unless you modify the code.
- tomperro1 year agoHelper V
I am trying to avoid changing multiple measures if I ever have the need to add or remove filters.
If each KPI has 4 measures, each with a set of filters and if I ever need to modify those filter, I would rather change it in once place rather that changing the 4 measures.