Forum Discussion

Nimai123's avatar
Nimai123
Post Patron
6 years ago
Solved

MoM error

I have a measure of MOM growth created 

 

 
Last Month GRS = CALCULATE( [GRS Distinct count] , DATEADD( 'Date Table'[FullDateAlternateKey],-1,MONTH))
 
 
I am not able to see the results of the past month, what should I do?
 
But when I choose the month slicer it works correctly.
 
 

 

 

 

amitchandak 

  • Nimai123 , Try like

     last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

5 Replies

  • Nimai123 of course with current visual it doesn't know which month to look at and that's why it is not working and when you select a month value, it works.

     

    Ask a question to yourself what you expect the result to be when a month is not select? How you want it to behave?

      • amitchandak's avatar
        amitchandak
        Super User

        Nimai123 , Try like

         last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Nimai123 ,

     

    Yes, this is related to the feature of measure, which is calculated according to the current context.

    When you select slicer, it means that the context changes so that the measure you created will take effect.

    Or you can recreate the measure, but you need to define your own filter conditions instead of using time intelligence functions.

    You can refer to this thread:https://community.powerbi.com/t5/Desktop/calculate-the-total-sales-of-last-3-months-vs-current-month-of/m-p/859498#M412345 

     

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