cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Days Between Dates with Negatives

Have used this one countless times. The problem is that DAYSBETWEEN DAX function does not allow returning negative values, so instead use:

 

DaysBetween = ROUNDUP(1.*[Date]-[OtherDate],0),

I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

3 REPLIES 3

Re: Days Between Dates with Negatives

Here is an ugly alternative 🙂

 

Column = IFERROR(
DATEDIFF(Dates[Date],Dates[OtherDate],DAY),
-DATEDIFF(Dates[OtherDate],Dates[Date],DAY )
)


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Highlighted
ElizabethTachji Regular Visitor
Regular Visitor

Re: Days Between Dates with Negatives

Hi,

 

How do you count only work days between two dates?

 

Thanks

Elizabeth Tachjian

elizabeth@analyticsrealtime.com.au

Elizabeth Tachjian
Super User
Super User

Re: Days Between Dates with Negatives

Just add a column to your Date table that will mark a date as a weekday or weekend day and then filter appropriately in your measures.

Best
Darek

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,384)