Forum Discussion
Anonymous
5 years agoNot applicable
Dynamic filter values
Hello everyone, I have an issue to correctly count the distinct products within dynamic filter options. This is my simple data model which consists of only one table. In the first column ...
- 5 years ago
Anonymous , Assume first date filter is working
M2 =
var _date = FIRSTDATE(Table[Creation Date])
var _value = CALCULATE(DISTINCTCOUNT(Table[Product Number]),filter( Table[Creation Date]=_date && ((Table[Country] = "Denmark" && Table[Sales Channel] = "DK Trade") || (Table[Country] = "France" && Table[Sales Channel] = "FR Retail"))
))
RETURN IF(ISBLANK(_value),0,_value)
AllisonKennedy
5 years agoCommunity Champion
Try using conditions and, or && ||
M2 =
var _date = FIRSTDATE(Table[Creation Date])
var _value = CALCULATE(DISTINCTCOUNT(Table[Product Number]), Table[Creation Date]=_date,
(Table[Sales Channel] = "DK Trade" && Table[Country] = "Denmark") ||
Table[Country] = "France" && Table[Sales Channel] = "FR Retail"))
)
RETURN IF(ISBLANK(_value),0,_value)
M2 =
var _date = FIRSTDATE(Table[Creation Date])
var _value = CALCULATE(DISTINCTCOUNT(Table[Product Number]), Table[Creation Date]=_date,
(Table[Sales Channel] = "DK Trade" && Table[Country] = "Denmark") ||
Table[Country] = "France" && Table[Sales Channel] = "FR Retail"))
)
RETURN IF(ISBLANK(_value),0,_value)
- Anonymous5 years agoNot applicable
When I did it as you said I got the error message: