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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
INJAINP
Frequent Visitor

blank value in if else

Hello Folks,

 

I have below scenario where if date1 is gretaer than date2 then it should display YES And otheriwse it should be  NO.

 

I want if Date 2 is blank then NO should be populated but it is populating YES.

 

Can anyone help me in knowing how to get this?

 

Thanks

Priyanka

3 ACCEPTED SOLUTIONS
SivaMani
Resident Rockstar
Resident Rockstar

@INJAINP,

 

Try the below DAX code,

 

IF(ISBLANK(date2),"NO", IF(date1 > date2, "YES","NO"))

 

Thanks,

Siva

View solution in original post

Anonymous
Not applicable

Hi @INJAINP

 

Write dax in this way 

Selection = IF(ISBLANK(Table1[Date2]),"No",
           IF(Table1[Date1]>Test2[Date2],"Yes","No"))

Hope this will help you!!!

View solution in original post

Hello Angad,

 

Thanks for your input.

 

The issue got resolved as I was just doing a minor mistake.

 

Thanks

Priyanka

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @INJAINP

 

Write dax in this way 

Selection = IF(ISBLANK(Table1[Date2]),"No",
           IF(Table1[Date1]>Test2[Date2],"Yes","No"))

Hope this will help you!!!

Hello Angad,

 

Thanks for your input.

 

The issue got resolved as I was just doing a minor mistake.

 

Thanks

Priyanka

@INJAINP

 

Please post your solution and mark as a solution or mark any of the replies as a solution that solved your problem. It will help people who are facing the same issue.

 

Thanks,

Siva

SivaMani
Resident Rockstar
Resident Rockstar

@INJAINP,

 

Try the below DAX code,

 

IF(ISBLANK(date2),"NO", IF(date1 > date2, "YES","NO"))

 

Thanks,

Siva

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.