Forum Discussion
Nested IF statement
- 4 years ago
The way DAX handles BLANKS can be somewhat confusing so in this case it can be something related to DAX never considering the value to be blank and evaluating it as FALSE everytime. A possible workaround can be:
SWITCH( TRUE(), SliderValue = BLANK(), 0, SliderValue = 0, Actual, SliderValue > 0, ProjRR, SliderValue )Check out this article as it may help you in this case or in a similar one in the future!
Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!
Best regards,
Gonçalo Geraldes
sure, here it is goncalogeraldes
VAR Actual = [Recycling Rate (PET)]
VAR AverageR = [Median Recycling Rate (PET)]
VAR SliderValue = [PETRecyclingRateOverride Value]
VAR ProjRR =
IF( SliderValue > 0, DIVIDE( SliderValue, 100, 0 ), Actual ) //var AverageRR = IF (SliderValue > 0, DIVIDE(SliderValue,100,0), AverageR)
RETURN
//IF ( SELECTEDVALUE (Jurisdiction[DRS Status]) = "Existing DRS" , ProjRR, AverageRR)
SWITCH(
TRUE(),
ISBLANK(SliderValue),0,
SliderValue = 0, Actual,
SliderValue > 0,ProjRR,
SliderValue
)
The way DAX handles BLANKS can be somewhat confusing so in this case it can be something related to DAX never considering the value to be blank and evaluating it as FALSE everytime. A possible workaround can be:
SWITCH(
TRUE(),
SliderValue = BLANK(), 0,
SliderValue = 0, Actual,
SliderValue > 0, ProjRR,
SliderValue
)
Check out this article as it may help you in this case or in a similar one in the future!
Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!
Best regards,
Gonçalo Geraldes