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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Selected Value, IF, IN, and multiple nested conditions

Hi all, I'm not having much luck with my Google Fu today. I'm trying to create a measure based on a Month slicer value, that checks what month is selected and returns a value (the number of hours in that month) that can be used in another measure to calculate Utilisation %.

 

I've tried the following two options without much luck:

 

Potential Berth Hours Available =
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "January", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "February", 672,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "March", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "April", 720,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "May", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "June", 720,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "July", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "August", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "September", 720,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "October", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "November", 720,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] = "December", 744,
0)))))))


Potential Berth Hours Available =
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] In { "January", "March", "May", "July", "August", "October", "December"}; 744;
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] In { "February"}; 672;
IF(SELECTEDVALUE('Berth Utilisation'[Month Name] In { "April", "June", "September", "November"};720;
0

 

I thought you could use IN, but am unsure. Can anyone assist, please?

2 ACCEPTED SOLUTIONS

@Anonymous 

 

You forgot a closing bracket right after [Month Name] .

So your formula should be:

IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "January", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "February", 672,

View solution in original post

IN should work as well if you add the closing bracket to formula and replace semicolons with commas.

 

Potential Berth Hours Available =
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) In { "January", "March", "May", "July", "August", "October", "December"}, 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "February", 672,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) In { "April", "June", "September", "November"}, 720,
0)))

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I should clarify the errors I am getting. The first formula attempt returns the error "Too many arguments were passed to the SELECTEDVALUE function. The maximum argument count for the function is 2."

The second formula didn't like the semi-colons so I replaced them with commas and I got the same error, and an incorrect parameter result too

@Anonymous 

 

You forgot a closing bracket right after [Month Name] .

So your formula should be:

IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "January", 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "February", 672,

Anonymous
Not applicable

Thank you ! Appreciate it, an embarrassingly simple fix.

Interested to know if IN works too, if anyone knows

IN should work as well if you add the closing bracket to formula and replace semicolons with commas.

 

Potential Berth Hours Available =
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) In { "January", "March", "May", "July", "August", "October", "December"}, 744,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) = "February", 672,
IF(SELECTEDVALUE('Berth Utilisation'[Month Name]) In { "April", "June", "September", "November"}, 720,
0)))
Anonymous
Not applicable

That works perfectly too, thank you! I like the IN option, as its tidier.

themistoklis
Community Champion
Community Champion

@Anonymous 

 

So the problem that you are experiencing is that the formulas do not return anything?

Or they return someting different from what you expected?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.