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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Stuznet
Helper V
Helper V

If Datesbetween True then Return Blank Future Dates

Hi guys,

 

I'm currently having trouble getting this statement right. 

Here is the situation,

If Date 1 ISBLANK and Date 2 ISBLANK return blank and if Date1 is greater than Date 2 return Future Date.

I don't know how to write this logic in DAX.

 

Can someon1 please help?

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

quite simple - with NOT 🙂

Column = IF(ISBLANK([Date1]) && 
            NOT(ISBLANK([Date2])), BLANK(),
         IF(YEAR([Date1]) > YEAR([Date2]),"Future"," "))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

5 REPLIES 5
Stachu
Community Champion
Community Champion

this is for a calculated column?
Something like this should work

Column =
IF (
    ISBLANK ( Table[Date1] ) && ISBLANK ( Table[Date2] ),
    BLANK (),
    IF ( Table[Date1] > Table[Date2], Table[Future Date], BLANK () )
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachuthank you for your response.

 

I revised the DAX function you provided.

Column = IF(ISBLANK([Date1]) && 
            ISBLANK([Date2]), BLANK(),
         IF(YEAR([Date1]) > YEAR([Date2]),"Future"," "))

and I would like to change Date2 to is not blank, how do I revise it?

Stachu
Community Champion
Community Champion

quite simple - with NOT 🙂

Column = IF(ISBLANK([Date1]) && 
            NOT(ISBLANK([Date2])), BLANK(),
         IF(YEAR([Date1]) > YEAR([Date2]),"Future"," "))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachuyou're da best!!! thank you so much ^^

Stachu
Community Champion
Community Champion

glad to help 🙂



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.