Forum Discussion
Anonymous
6 years agoNot applicable
DAX If statement based on selected filter
Hello,
is it possible to reference a filter using a DAX formula?
e.g. IF (Filter = "Selcet All",1,2)
Thanks for your help
Hi Anonymous
You can do something like this, where you are comparing the total number of items in the column used to the number selected in the filter:
IF ( COUNTROWS ( DISTINCT ( FilterTable[FilterColumn] ) ) = COUNTROWS ( ALL ( FilterTable[FilterColumn] ) ), 1, 2 )Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.
Cheers

1 Reply
- AlBCommunity Champion
Hi Anonymous
You can do something like this, where you are comparing the total number of items in the column used to the number selected in the filter:
IF ( COUNTROWS ( DISTINCT ( FilterTable[FilterColumn] ) ) = COUNTROWS ( ALL ( FilterTable[FilterColumn] ) ), 1, 2 )Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.
Cheers
