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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mohammadyousaf
Helper III
Helper III

Datediff for same dates.

How do we tackle this issue... datediff calculate 0 where both dates are same. 

 

Date StartDate End
11 October 202111 October 2021

 

DATEDIFF([DATE START], [DATE END], DAY)

Result "0"

1 ACCEPTED SOLUTION

Your welcome, I mean you can try something like this instead

 

If (startday=enddate), 1 , DATEDIFF([DATE START], [DATE END], DAY))

View solution in original post

3 REPLIES 3
Applicable88
Impactful Individual
Impactful Individual

@mohammadyousaf what value do you expect? Since its the same day there is no difference in value. If you want that same day displayed as one than try: 

if (DATEDIFF([DATE START], [DATE END], DAY))= 0, 1, DATEDIFF([DATE START], [DATE END], DAY))

 

Hope that helps. 

Best. 

Thank you, I guess IF workaround should be ok, let me try it.

 

In our line of business... it is calculated as working day regardless of working hours. 

I am trying to find a way where one day is included in the calculations of two dates... even if dates are apart, I miss the first day as working day

 

Your welcome, I mean you can try something like this instead

 

If (startday=enddate), 1 , DATEDIFF([DATE START], [DATE END], DAY))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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