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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lynnzrae
Helper I
Helper I

DATEDIFF between two dates or if one date isn't given DATEDIFF between one date and today

I am creating a new column to identify the cycle time for projects.

I want to create a formula so that I datediff from the start date to the complete date and if there is not a complete date (complete date is blank) I want to datediff from the start date to today.  Thank you for your help.

 

Project Start DateProject Complete DateProject Cycle Time
1/15/20241/31/2024 
2/9/2024  
3/5/20246/1/2024 
1/16/20242/27/2024 
6/5/2024  
1 ACCEPTED SOLUTION
BeaBF
Super User
Super User

@lynnzrae Here the calculated column:

Project Cycle Time_BBF =
IF(
    ISBLANK('Table'[Project Complete Date]),
    DATEDIFF('Table'[Project Start Date], TODAY(), DAY),
    DATEDIFF('Table'[Project Start Date], 'Table'[Project Complete Date], DAY)
)
output:
BeaBF_0-1721392014721.png

 

BBF

View solution in original post

2 REPLIES 2
lynnzrae
Helper I
Helper I

Perfect, thank you.

BeaBF
Super User
Super User

@lynnzrae Here the calculated column:

Project Cycle Time_BBF =
IF(
    ISBLANK('Table'[Project Complete Date]),
    DATEDIFF('Table'[Project Start Date], TODAY(), DAY),
    DATEDIFF('Table'[Project Start Date], 'Table'[Project Complete Date], DAY)
)
output:
BeaBF_0-1721392014721.png

 

BBF

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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