Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

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.
1 ACCEPTED SOLUTION
johnt75
Super User
Super 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 )

View solution in original post

1 REPLY 1
johnt75
Super User
Super 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 )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.