Forum Discussion
Stuznet
Helper V
7 years agoRewrite IF function
Hi all,
I’m currently struggling to rewrite this excel formula to DAX.
Excel formula
IFERROR( IF(A2-B2 >= -1, “Yes”, IF ( B2 = “ “, “No”, “No”)), “No”)
I’ve tried to write in DAX, but I’m getting different count
IFERROR(IF(Table1[Date1] - [Date2] >= -1, “Yes”,
IF([Date2] = BLANK(), “No”,”No”)),”No”)
Can some please help?
Thanks much!
I’m currently struggling to rewrite this excel formula to DAX.
Excel formula
IFERROR( IF(A2-B2 >= -1, “Yes”, IF ( B2 = “ “, “No”, “No”)), “No”)
I’ve tried to write in DAX, but I’m getting different count
IFERROR(IF(Table1[Date1] - [Date2] >= -1, “Yes”,
IF([Date2] = BLANK(), “No”,”No”)),”No”)
Can some please help?
Thanks much!
- Anonymous7 years ago
Perhaps
IF( Table1[Date1] - Table1[Date2] < -1 || ISBLANK(Table1[Date2]), "No", "Yes")
4 Replies
- AnonymousNot applicable
Perhaps
IF( Table1[Date1] - Table1[Date2] < -1 || ISBLANK(Table1[Date2]), "No", "Yes")
- Stuznet
Helper V
Thank you so much your solution works great :)
- themistoklis
Community Champion
Are you sure it is blank and not just an empty cell?
Maybe the following?
IFERROR(IF((Table1[Date1] - Table1[Date2]) >= -1, "Yes", IF(OR(Table1[Date2] = BLANK(), Table1[Date2]="", LEN(Table1[Date2]) = 0), "No","No")),"No")
- Greg_Deckler
Community Champion
I'm guessing you need to use "" instead of BLANK(). Sample data would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490