Forum Discussion
return today's sales
I wanted to return the sales for today using following formula:
Hi Anonymous ,
The Today function will return the latest day and do not need to specify manually the (yy-mm-dd), you just need to ues it as a filter condition in your measure, you could see the details of the function:https://docs.microsoft.com/en-us/dax/today-function-dax
The TODAY function is useful when you need to have the current date displayed on a worksheet, regardless of when you open the workbook. It is also useful for calculating intervals.
Regards,
Daniel He
4 Replies
- v-danhe-msft
Microsoft Employee
Hi Anonymous ,
Could you have refered to TODAY() function?
https://docs.microsoft.com/en-us/dax/today-function-dax
Refered formula:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Date]<=TODAY()))You could also download the pbix file to have a view.
Regards,
Daniel He
- AnonymousNot applicable
Thank you for your answer v-danhe-msft .
My question was what is the function or variable when you want to refer to today's calendar date? I know for Today() I need to specify manually the (yy-mm-dd) but what function to use to do it automatically which can be updated everyday on? and bytheway, I have a measured date's table created by a DAX measuered formula. Is it possible to use it or I have to create a table like yours?
- v-danhe-msft
Microsoft Employee
Hi Anonymous ,
The Today function will return the latest day and do not need to specify manually the (yy-mm-dd), you just need to ues it as a filter condition in your measure, you could see the details of the function:https://docs.microsoft.com/en-us/dax/today-function-dax
The TODAY function is useful when you need to have the current date displayed on a worksheet, regardless of when you open the workbook. It is also useful for calculating intervals.
Regards,
Daniel He