Forum Discussion

dbrandone's avatar
dbrandone
Helper IV
5 years ago
Solved

Last Month Calculations not functioning

Hey everyone,   I have the below measure that I am trying to calculate, but I cannot figure out why the dates between section is not filtering the data. The result is showing "Blank", but according...
  • v-deddai1-msft's avatar
    v-deddai1-msft
    5 years ago

    Hi dbrandone ,

     

    Please check the relationship between your calendar table and vsales table. It should be one to many active relationship.

     

    You can also use the following measure:

     

    Items sold Last Month = 
                    VAR vToday =
                             TODAY ()
                    VAR vEndDate =
                             EOMONTH ( vToday, -1 )
                  
                    VAR vResult =
                             CALCULATE(
                                         COUNT(vSales[ItemSold]),
                                                        DATESINPERIOD('Calendar'[Date], vStartDate, 1,MONTH)
    )
    Return
           vResult

     

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

     

    Best Regards,

    Dedmon Dai