Forum Discussion
Filtering Matrix Hierarchy by Parent's Measure Value
- 4 years ago
Try defining a new parameter that has values from 0% - 100% and create a measure to filter based on those parameter values in a slicer.
I defined a new table named Range and defined this as a filter measure.
InSelectedRange = VAR Level1Growth = CALCULATE ( [YTD vs PYTD Revenue %], ALLSELECTED (), VALUES ( Companies[Level 1] ) ) VAR RangeBuckets = FILTER ( Range, Range[Range] <= Level1Growth && ( Range[Range] = 1 || Range[Range] + 0.1 > Level1Growth ) ) RETURN IF ( ISEMPTY ( RangeBuckets ), 0, 1 )See attached file.
Try defining a new parameter that has values from 0% - 100% and create a measure to filter based on those parameter values in a slicer.
I defined a new table named Range and defined this as a filter measure.
InSelectedRange =
VAR Level1Growth =
CALCULATE (
[YTD vs PYTD Revenue %],
ALLSELECTED (),
VALUES ( Companies[Level 1] )
)
VAR RangeBuckets =
FILTER (
Range,
Range[Range] <= Level1Growth
&& ( Range[Range] = 1
|| Range[Range] + 0.1 > Level1Growth )
)
RETURN
IF ( ISEMPTY ( RangeBuckets ), 0, 1 )
See attached file.
Thank you AlexisOlson, I am going to try and implement into my model. Question is there a way to filter a whole page for just the customers that fall in the ranage?
- AlexisOlson4 years ago
Super User
You could define a calculated column on the Companies table that buckets each [Level 1] into the corresponding range and then use that column for your slicer. This isn't dynamic though. Each [Level 1] item can only have a single value regardless of what report filters you have.
- nbs334 years ago
Helper II
Ok I'll play with that and see if the end result gets me close.
I added your measure filter to my model and it works except if I have a year selected in my date slicer. Do I need to add some type of date filter in the Level1Growth variable?InSelectedRange = VAR Level1Growth = CALCULATE ( [YTD vs PYTD Revenue %], ALLSELECTED (), VALUES ( Companies[Level 1] ) ) VAR RangeBuckets = FILTER ( Range, Range[Range] <= Level1Growth && ( Range[Range] = 1 || Range[Range] + 0.1 > Level1Growth ) ) RETURN IF ( ISEMPTY ( RangeBuckets ), 0, 1 )- AlexisOlson4 years ago
Super User
I'm not sure what you're saying doesn't work.
This is an example of what I see with a year selected:
Is this not the expected output?