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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.