Forum Discussion
Syndicate_Admin
4 years agoAdministrator
If nested by selecting two values from a column
Good morning
I have to make an if on a condition of one month accumulated, that is:
* if Dates[Month-Copy Name] has both January and February selected in a filter.
I've tried:
- SELECTEDVALUE(Dates[Name Month-Copy])= "JANUARY" && "FEBRUARY"
- SELECTEDVALUE(Dates[Month-Copy Name])= "JANUARY" && SELECTEDVALUE(Dates[Month-Copy Name])="FEBRUARY"
but it does not work for me if I have selected both months.
Thanks a lot.
SELECTEDVALUE only works when there is a single value selected. You could use something like
test =
var chosenMonths = VALUES( 'Date'[Month Name] )
return IF( COUNTROWS( chosenMonths ) = 2 && "Jan" IN chosenMonths && "Feb" IN chosenMonths, 1, 0 )
1 Reply
- johnt75Super User
SELECTEDVALUE only works when there is a single value selected. You could use something like
test =
var chosenMonths = VALUES( 'Date'[Month Name] )
return IF( COUNTROWS( chosenMonths ) = 2 && "Jan" IN chosenMonths && "Feb" IN chosenMonths, 1, 0 )