Forum Discussion
Slicer by logic conditions
- 3 months ago
Hi RRSSDW
To handle this kind of requirement with filter options consisting of overlapping sets, I would usually set up the model as follows (using your example):
- Creating a
Typedimension (if it doesn't already exist). - Create a
Type Filtertable containing the combinations of required filter options and correspondingTypevalues.Type Filter = "A"..."E"correspond to individualTypevalues of the same name, whileType Filter = "All Content"corresponds toType = "A"..."E". - Create bidirectional many-to-one relationship between
'Type Filter'[Type]andType[Type]. - Use
'Type Filter'[Type Filter]on the slicer. - Apply a page-level or report-level filter on
'Type Filter'[Type Filter]to limit the options as required, e.g."A"and"All Content".
In effect, this models a many-to-many relationship between
TypeandType Filter. This avoids having to handle the filtering via DAX.This is similar modelling used for overlapping date ranges in this blog post.
Small example PBIX attached.
- Creating a
What are the slicers helping quantify on the page? I am guessing they help filter measures of somekind as they want to see totals for A only and then total for all types. My suggestion might be to take away the selection and just make two measures that total those specific things.
A Total = CALCULATE(MeasureName, Type = A)
You could either just the next one make this the overall total or specify each type in a calculate:
All Content Total = CALCULATE(MeasureName, Type IN {A,B,C,D})
Not sure how many measures you have on the page but just a different way to see the same breakdown -- this way you would also be able to see those totals side by side and also create other comparison measure for the totals.