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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MickeLearnPBI
Helper I
Helper I

DATEDIFF: Exclude if the date is XXXX

Hi

I want to count the days between start and end, but if the EndDate is 2099-01-01 i want it to be blank or show a value.

Do you have any tips how I would do this?

 

Days between = DATEDIFF(
    Investigations[InvestigationStartDate],
    Investigations[InvestigationEndDate],
    DAY)
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @MickeLearnPBI 

You just have drafted the answer in your question itself. 
Days between =
IF (
Investigations[InvestigationEndDate] <> DATE ( 2099, 01, 01 ),
DATEDIFF (
Investigations[InvestigationStartDate],
Investigations[InvestigationEndDate],
DAY
)
)

View solution in original post

2 REPLIES 2
MickeLearnPBI
Helper I
Helper I

Thank you! 👍

tamerj1
Super User
Super User

Hi @MickeLearnPBI 

You just have drafted the answer in your question itself. 
Days between =
IF (
Investigations[InvestigationEndDate] <> DATE ( 2099, 01, 01 ),
DATEDIFF (
Investigations[InvestigationStartDate],
Investigations[InvestigationEndDate],
DAY
)
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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