cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jalaomar
Helper II
Helper II

How to return correct value for multiple IF statements

Hi all,

 

Anyone knows how I can fullfill my measure that I am trying to work as the following 

 

if  PVoT Days <= 0 then return 1 (true) else 0 (false)

if PVoT Days has Blank value then retun 0

if PVoT Days >= 1 then return 0 (false) 

 

In the screenshot you can see that my measure works for the 2 first statment, how can i add the 3rd statment (if PVoT is >= 1 then return 0)?

2021-09-29_11-14-00.png

1 ACCEPTED SOLUTION
Marik
Solution Supplier
Solution Supplier

@jalaomar Use SWITCH function:

SWITCH(TRUE(),

   ISBLANK([PVoT Days]),0,

   [PVoT Days]>=1,0,

   [PVoT Days]<=0,1,

   0)

View solution in original post

2 REPLIES 2
jalaomar
Helper II
Helper II

Hi @Marik, the measure is working perfectly 

Many thanks for the support! 🙂

Marik
Solution Supplier
Solution Supplier

@jalaomar Use SWITCH function:

SWITCH(TRUE(),

   ISBLANK([PVoT Days]),0,

   [PVoT Days]>=1,0,

   [PVoT Days]<=0,1,

   0)

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors