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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
dferry
Helper I
Helper I

If Then Else to calculate a date

I am trying to calculate a date by using two date columns.  I want to use column  mos_d_override first but if there is a null value then i want to use mos_d_schedule.  I get results but not correct results.  The results of this formula are used in another formula to calculate past due days.  I  am new to this so please bear with me.  Thank you.

if [mos_d_override] is null then Date.AddDays([d_schedule] else Date.AddDays([mos_d_override]

 

2 ACCEPTED SOLUTIONS
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @dferry ,

 

How about this?

if [mos_d_override] is null then [d_schedule] else [mos_d_override]


Let me know, if this solves your issue 🙂

 

/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

This worked great.  Thank you as overthinking got me once again.  Thank you again.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

As @tackytechtom said, but you should use the syntax

 

if [Date] = null

 

instead of

 

if [Date] is null

 

--Nate

Sorry, this didn't work.  Thank you for your time.

tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @dferry ,

 

How about this?

if [mos_d_override] is null then [d_schedule] else [mos_d_override]


Let me know, if this solves your issue 🙂

 

/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 

This worked great.  Thank you as overthinking got me once again.  Thank you again.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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