Forum Discussion
Narendra90
3 years agoFrequent Visitor
dynamic filter criteria
Hi Team, I have created mulitiple measures in dashboard. All measures based on different columns ( Project value, Initial value, Actual value, No of emp etc). However everyone has same filter criter...
- 3 years ago
You can create a measure and reference that in another measure
filter measure = CALCULATE ( COUNTROWS ( 'table' ), FILTER ( 'table', 'table'[country] = "India" && 'table'[year] = 2021 ) )another measure = CALCULATE ( SUM ( 'table'[value] ), FILTER ( 'table', [filter measure] <> BLANK () ) )
danextian
Super User
3 years agohi Narendra90 ,
You can create a calculated column based on a certain logic and use it to filter the entire report or just a page.
Filter column =
'table'[country] = "India"
&& 'table'[year] = 2021
this will return TRUE/FALSE. Use this in the filter pane and set the value to true. Or
Filter column =
IF ( 'table'[country] = "India" && 'table'[year] = 2021, 1, 0 )
For the above, set the value to 1. Or if you have list of countries in another table which is updated as needed
Filter column =
VAR _COUNTRY =
LOOKUPVALUE (
'country table'[country],
'country table'[country], 'table'[country]
)
RETURN
IF ( NOT ( ISBLANK ( _COUNTRY ) ) && 'table'[year] = 2021, 1, 0 )
The filter logic depends entirely on how you expect your data will change.