Forum Discussion
NOVICE02
Helper III
6 years agofilter with multiple conditions
Hi all, Stuck here.. Data looks like this: Ban PTP handled D 123 0 y 0 456 1 y 1 789 0 y 0 788 0 y 1 What i need to do is this: I want to count the bans with...
- 6 years ago
Hey,
I would create this measure:
Measure = var filtertable = UNION( ROW("handled" , "Y" , "D" , 0 , "ptp" , 0) , ROW("handled" , "Y" , "D" , 0 , "ptp" , 1) , ROW("handled" , "Y" , "D" , 1 , "ptp" , 1) ) return CALCULATE( COUNTROWS('Table') , TREATAS(filtertable , 'Table'[handled] , 'Table'[D] , 'Table'[PTP]) )Based on the sample data you provided, the measure returns 3 and can be used e.g. on a card visual like so:
Hopefully this is what you are looking for.
Regards,
Tom
TomMartens
Super User
6 years agoHey,
I would create this measure:
Measure =
var filtertable =
UNION(
ROW("handled" , "Y" , "D" , 0 , "ptp" , 0)
, ROW("handled" , "Y" , "D" , 0 , "ptp" , 1)
, ROW("handled" , "Y" , "D" , 1 , "ptp" , 1)
)
return
CALCULATE(
COUNTROWS('Table')
, TREATAS(filtertable , 'Table'[handled] , 'Table'[D] , 'Table'[PTP])
)
Based on the sample data you provided, the measure returns 3 and can be used e.g. on a card visual like so:
Hopefully this is what you are looking for.
Regards,
Tom
NOVICE02
Helper III
6 years agoAmazing!! Thank you so much , it worked!