Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Question about Prior Month Measure against custom measure using distinctcount

I have a measure I created:

Total Staff = var _table=SUMMARIZE('All_NICE_Data','All_NICE_Data'[Agent Name],'Calendar Dates'[Date],"distinctcount",DISTINCTCOUNT('All_NICE_Data'[Agent Name]))
return
SUMX(_table,[distinctcount])
 
This validates perfectly.
 
Now I need to create a calculation to get the prior month calculations.
Normally I would use:
Previous Month Staff =
CALCULATE(
   SUM('All_NICE_Data'[Total Staff])
   ,
    DATEADD(
        'Calendar Dates'[Date],
        -1,
        MONTH
    )
)
 
This is not working.
 
How do I calculate the Previous month against the Total Staff measure?
  • You cannot measure a measure.  Use it directly.

     

    Previous Month Staff =
    CALCULATE(
       [Total Staff]   ,
        DATEADD(
            'Calendar Dates'[Date],
            -1,
            MONTH
        )
    )

1 Reply

  • You cannot measure a measure.  Use it directly.

     

    Previous Month Staff =
    CALCULATE(
       [Total Staff]   ,
        DATEADD(
            'Calendar Dates'[Date],
            -1,
            MONTH
        )
    )