Forum Discussion
ThomasWeppler
1 year agoImpactful Individual
Selectedvalue() doesn't work when multiple options are selected
Hi Power BI community I have a filter that can choose between three options called A,B and C When I write this DAX code Status = IF(SelectedValue(table[status]) = "A",1,0) Then I get 1 if A...
- 1 year ago
SELECTEDVALUE by default always returns blank if more than one values are visible (two or emore selected, or none selected which is equivalent to all). To check whether A is in the selected values. try
-- Returns 1 if "A" is present in visible rows of 'table'[status] , otherwise returns 0 IF ( "A" IN VALUES ( 'table'[status] ), 1, 0 )This will, of course, naturally return 0 if A is not among the selected values.
danextian
1 year agoSuper User
SELECTEDVALUE by default always returns blank if more than one values are visible (two or emore selected, or none selected which is equivalent to all). To check whether A is in the selected values. try
-- Returns 1 if "A" is present in visible rows of 'table'[status] , otherwise returns 0
IF ( "A" IN VALUES ( 'table'[status] ), 1, 0 )
This will, of course, naturally return 0 if A is not among the selected values.
ThomasWeppler
1 year agoImpactful Individual
Thanks danextian it works as a charm and solved my problem write a way.
with a very short and elegant line of DAX.