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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
OobuJoobu
Frequent Visitor

Calculated Table Column, Difference between 2 dates, only when both are populated

I have a table that contains, among many others, fields called "DateScreened" and "DateOffered".

 

I need to create a new column ("Date Screeened to Date Offered") that shows the number of days between the 2 dates, but only when both are populated (it is not mandatory for either of these rows to be populated).

 

My new column is currently built like this:

Date Screened to Date Offered = [DateOffered] - [DateScreened]
 
It works perfectly when both dates are populated, but returns, for example, 44916 where the Date Screened is not populated (I understand why, I don't need that answering), I just need it to be blank where either date doesn't exist.
 
Anyone got a way to do this please?

 

 

2 ACCEPTED SOLUTIONS
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @OobuJoobu,

 

How about this:

Date Screeened to Date Offered = 
IF ( 
    OR ( ISBLANK ( [DateOffered] ), ISBLANK ( [DateScreened] )),
    BLANK(),
    [DateOffered] - [DateScreened]
)

 

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

Absolutely perfect, thank you!

View solution in original post

4 REPLIES 4
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @OobuJoobu,

 

How about this:

Date Screeened to Date Offered = 
IF ( 
    OR ( ISBLANK ( [DateOffered] ), ISBLANK ( [DateScreened] )),
    BLANK(),
    [DateOffered] - [DateScreened]
)

 

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Absolutely perfect, thank you!

nvprasad
Solution Sage
Solution Sage

Hi,

You can try below DAX

Date Screened to Date Offered =  IF( [DateScreened] = BLANK(), BLANK(),[DateOffered] - [DateScreened])

 

Appreciate a Kudos! ‌‌
If this helps and resolves the issue, please mark it as a Solution! ‌‌

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Thank you, I expect that works perfectly, I've already tried the solution from @tackytechtom whch does the job lso.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.