Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

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

  • 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 )