Forum Discussion

Arul's avatar
Arul
Super User
7 years ago
Solved

DIFFERENCE BETWEEN DATESMTD AND TOTALMTD

Hi all,

What is the difference between DATESMTD and TOTALMTD.

Thanks,

-Arul

  • Hi Arul ,

     

    TOTALMTD(): Evaluates the value of the expression for the month to date, in the current context. This works for the expresion from 1st to the last day of the monrh .It is equivalent to CALCULATE([measure],DATESMTD(DimDate[Date])).

     

    eg:TOTALMTD = TOTALMTD(SUM(Sales[SalesAmount]),Sales[DateKey])

     

    DATESMTD(): Returns a table that contains a column of the dates for the month to date, in the current context. This works in a date dimension, which must have contiguous, nonrepeating dates from January 1 of the first year you have data to December 31 of the last year you have data. The function returns a 1 column table made up of dates between the first of the month of the current date in context and the current date in context.

     

    eg: DATESMTD = CALCULATE(SUM(Sales[SalesAmount]),DATESMTD(Sales[DateKey]))

     

     

     

     

     

     

     

     

     

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Arul ,

     

    TOTALMTD(): Evaluates the value of the expression for the month to date, in the current context. This works for the expresion from 1st to the last day of the monrh .It is equivalent to CALCULATE([measure],DATESMTD(DimDate[Date])).

     

    eg:TOTALMTD = TOTALMTD(SUM(Sales[SalesAmount]),Sales[DateKey])

     

    DATESMTD(): Returns a table that contains a column of the dates for the month to date, in the current context. This works in a date dimension, which must have contiguous, nonrepeating dates from January 1 of the first year you have data to December 31 of the last year you have data. The function returns a 1 column table made up of dates between the first of the month of the current date in context and the current date in context.

     

    eg: DATESMTD = CALCULATE(SUM(Sales[SalesAmount]),DATESMTD(Sales[DateKey]))

     

     

     

     

     

     

     

     

     

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi  Arul ,

     

    Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case.

     

    Best regards

    Amy Cai