cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
req7
Helper IV
Helper IV

How to subtract the number of days from TODAY() until a specific date

I created a measure called _dateInc that brings me the date when the last product was lost.
I would like to know how many days the stock has been without losing new products, and with that, I would like to subtract TODAY() with the day of the last loss (_dateInc). I tried to use:

measure = TODAY () - [_dateInc]

but I received a strange date, with the year set in 1900. I just want to know the number of days.

1 ACCEPTED SOLUTION
DataZoe
Super User II
Super User II

@req7 Please try 

measure = DATEDIFF([_dateInc],TODAY(),DAY)

https://docs.microsoft.com/en-us/dax/datediff-function-dax 

Respectfully,
DataZoe


See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@req7 , You can subtract and add Days date without any function.  If you subtract a date from date, it will return diff in term of timestamp

Use date diff if these are two dates

datediff(TODAY () , [_dateInc],DAY)

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

DataZoe
Super User II
Super User II

@req7 Please try 

measure = DATEDIFF([_dateInc],TODAY(),DAY)

https://docs.microsoft.com/en-us/dax/datediff-function-dax 

Respectfully,
DataZoe


See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors