Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi guys,
I need help writing nested IF isblank statement.
Here is my currently working dax function but I have another condition that I need to include in this statement.
AgeBracket = IF('Data'[Date1]<31,"0-30 Days", IF('Data'[Date1]'<46, "31-45 Days","45+Days"))
So basically, Current Date minus Date1 if is blank then use Date2. If you look at the last row as an example.
How do I write a proper statement for this logic?
Thank you
| Date1 | Date2 | Age Bracket |
| 6/1/2018 | 8/4/2018 | 45+Days |
| 6/14/2018 | 8/4/2018 | 45+Days |
| 5/13/2018 | 8/8/2018 | 31-45 Days |
| 10/1/2017 | 8/9/2018 | 31-45 Days |
| 8/8/2018 | ?? |
Solved! Go to Solution.
Hi @Stuznet,
Try this one, please.
Column =
VAR date1 =
IF ( ISBLANK ( [Date1] ), [Date2], [Date1] )
VAR days =
TODAY () - date1
RETURN
IF ( days < 31, "0-30 days", IF ( days < 46, "31-45 days", "45 + days" ) )
Best Regards,
Dale
create on e calculated column
Date = IF('Data'[Date1] = BLANK(),TODAY())
after that apply your function
@balaganeshv2201I tried incorporate the formula you provided but I'm getting incorrect syntax highlighted in red.
AgeBracket = IF('Data'[Date1]=BLANK(),TODAY())"0-30 Days", IF('Data'[Date1]<46, "31-45 Days","45+Days"))How do I tell DAX if Date 1 is blank then look for Date2 then give me 0-30 Days, 31-45 Days or 45+Days result? Could you please elaborate or educate me the proper function?
Hi @Stuznet,
Try this one, please.
Column =
VAR date1 =
IF ( ISBLANK ( [Date1] ), [Date2], [Date1] )
VAR days =
TODAY () - date1
RETURN
IF ( days < 31, "0-30 days", IF ( days < 46, "31-45 days", "45 + days" ) )
Best Regards,
Dale
Thank you so much for youe work 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |