Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

return today's sales

I wanted to return the sales for today using following formula:

TotalSalesinToday =
var Today = FILTER(CALENDAR(DATE(2019,04,04), DATE(2019,04,04))
return sumx(Today, [TotalSales])
How I can use the a function to return today's total sales value?
 
  • 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

    • Anonymous's avatar
      Anonymous
      Not 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's avatar
        v-danhe-msft
        Icon for Microsoft Employee rankMicrosoft 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