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

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

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
Super User
Super User

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
Super User
Super User

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.