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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
romovaro
Responsive Resident
Responsive Resident

DAX - Use this date, if blank use another date

HI All

 

I need some help with one DAX formula.

I have 2 columns with dates.

 

Signed = Date when contract was signed

LOA Signature Date

 

Currently, to calculate the ageing I was only using the Signed Column.

BL in Months = DATEDIFF(SFF[Signed], TODAY(), MONTH)
 
Now I have been told to update the formula. If there is a date in the LOA Signature Date column , we will use that first...if Blank, we will use the Signed Date.
 
I guess should start like this....
BL in Months = DATEDIFF(SFF[LOA Signature Date], TODAY(), MONTH)

but 

IF ( SFF[LOA Signature Date] = BLANK (),  'SFF[Signed])

 

or something like this? any help? thanks

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@romovaro , Try like

 

BL in Months = DATEDIFF(coalesce(SFF[LOA Signature Date], SFF[Signed]), TODAY(), MONTH)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

selimovd
Super User
Super User

Hey @romovaro ,

 

how do you want to use that? Is that a calculated column?

In this case the following approach should work:

BL in Months =
VAR vCompareDate =
    IF (
        SFF[LOA Signature Date] <> BLANK (),
        SFF[LOA Signature Date],
        SFF[Signed]
    )
RETURN
    DATEDIFF ( vCompareDate, TODAY (), MONTH )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

5 REPLIES 5
selimovd
Super User
Super User

Hey @romovaro ,

 

how do you want to use that? Is that a calculated column?

In this case the following approach should work:

BL in Months =
VAR vCompareDate =
    IF (
        SFF[LOA Signature Date] <> BLANK (),
        SFF[LOA Signature Date],
        SFF[Signed]
    )
RETURN
    DATEDIFF ( vCompareDate, TODAY (), MONTH )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

romovaro
Responsive Resident
Responsive Resident

Thanks Denis. It works

Hey @romovaro ,

 

I'm happy it worked 😊.

Could you also mark my approach as solution as it also worked?

 

Like this the next person who is stumbling across this post will see immediately which approaches work without scrolling through the post.

 

Thank you and have a great day

Denis

 

amitchandak
Super User
Super User

@romovaro , Try like

 

BL in Months = DATEDIFF(coalesce(SFF[LOA Signature Date], SFF[Signed]), TODAY(), MONTH)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks. It works

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors