Forum Discussion
Achieving Filtering in Dynamic Power BI Matrix
- 2 years ago
try to create a new measure like this:qualifier = VAR selected_measure = SWITCH( SELECTEDVALUE(field_parameter_table[Fields]), "'mesaure_table'[Clicks]", [Clicks], "'mesaure_table'[Bounces]", [Bounces], ... ) RETURN IF( selected_measure = 0, FALSE(), TRUE() )You will have to declare every measure you are using in your field parameter. The variable "selected_measure" will return the corresponding measure based on the current selection. If this measure is 0, the "qualifier" measure will return false, otherwise true. You can use this measure as a report filter and filter by qualifier = true.
Do not forget to replace the table and field names with the correct ones from your model.
CheersTim
- 2 years ago
Thank you timalbers the solution worked with a small modificaton
qualifier = VAR selected_measure = SWITCH( SELECTEDVALUE(field_parameter_table[Fields]), "'_Helper>Metric List'[Bounce % 2]", [Bounce % 2], "'_Helper>Metric List'[Bounce]", [Bounce], "'_Helper>Metric List'[Clicks]", [Clicks], ) RETURN selected_measure
try to create a new measure like this:
qualifier =
VAR selected_measure =
SWITCH(
SELECTEDVALUE(field_parameter_table[Fields]),
"'mesaure_table'[Clicks]", [Clicks],
"'mesaure_table'[Bounces]", [Bounces],
...
)
RETURN
IF( selected_measure = 0, FALSE(), TRUE() )
You will have to declare every measure you are using in your field parameter. The variable "selected_measure" will return the corresponding measure based on the current selection. If this measure is 0, the "qualifier" measure will return false, otherwise true. You can use this measure as a report filter and filter by qualifier = true.
Do not forget to replace the table and field names with the correct ones from your model.
Cheers
Tim