Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Previous Month Target

Hi everyone,   I've had a look around but I can't find the answer on the forums.   I am trying to duplicate the following measure, but change it so that it gives me the previous month to use as a...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    Please create a Date table and create the below measures, then put the new measures and Date fields of Date table on visual.

    Active persons this month =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[PERSON_ID] ),
        FILTER (
            'Table',
            ISBLANK ( 'Table'[END_DATE] )
                || 'Table'[END_DATE] > MAX ( 'Date'[Date] )
        )
    )
    Active persons last month = CALCULATE([Active persons this month],PREVIOUSMONTH('Date'[Date]))
    Active persons same month last year = CALCULATE([Active persons this month],SAMEPERIODLASTYEAR('Date'[Date]))

    Best Regards

    Rena