Goal: Filter all visuals on page based on a measure #1250
Replies: 1 comment 1 reply
-
Have you considered simply adding a calculated column on your Customer dimension, containing Of course, this approach will not work if you need the qty to be dynamic based on other filters on the page. In that case, you’d have to add the same logic as you described to every measure you intend to display on the page, or alternatively, you could use a calculation group. In general I would say, that if you only need this logic on a small number of measures relative to the total number of measures in your model, I would just copy paste the measures needed with the logic. |
Beta Was this translation helpful? Give feedback.
-
Filtering by measure at page level has never been possible as far as know.
I want every visual on page to show results FOR EACH CUSTOMER where Measure [Max Qty Bought] defined as Max ( Fact[Qty Bought]) is between whatever values a user chooses in a slicer with a slider showing the RANGE resulting from filtering on the page.
Following pattern a few people have posted, I can:
Create a calculated table named: Filter Measure Qty as GENERATESERIES( 0 , [Max Qty Bought], 1 )
Create a slicer and put the field VALUE in the field well.
Create a measure to apply to visual of the slicer and choose 1.
VAR _Virtual = SUMMARIZE( Fact,
Fact [Customer_ID] ,
"@x", Max Qty Bought]
)
VAR _Min_Value = MINX( _Virtual, [@x] )
VAR _Max_Value = MAXX( _Virtual, [@x] )
VAR _Current_Slicer_Value = SELECTEDVALUE( 'Filter Measure Qty'[Value] )
Return
IF( _Current_Slicer_Value >= _Min_Value && _Current_Slicer_Value <= _Max_Value ,
1,
0
)
The slicer shows the correct range
Then for a table visual that has columns:
Customer_ID
, [Total Amount]
, [Max Qty Bought]
I add filter level measure that flags a 1 if the customer meets the criteria.
Measure: Measure Filter Max =
VAR _Min_Value = Min ('Filter Measure Qty'[Value])
VAR _Max_Value = Max ('Filter Measure Qty'[Value])
VAR _Current_Measure_Value = [Max Qty Bought]
VAR _Result = If ( _Current_Measure_Value >= _Min_Value && _Current_Measure_Value <=_Max_Value ,
1 ,
0
)
Return
If ( [Total Amount] > 0 , _Result , Blank())
This filters the table great and will display X number of customers.
But I have 6 cards on the page with different measures. Ie Total Customers, Total Products. Etc
Those visuals do not change.
How can have those visuals also show the correct totals based on the slicer that correctly filters the table?
ie My 1 card to show to X Total Customers.
If this is possible, it almost seems like you need a calculation group to apply it to all other measures??
Beta Was this translation helpful? Give feedback.
All reactions