Forum Discussion

PatrickLamoste's avatar
6 years ago
Solved

Same Period Last Year

Hi,   I am working with a data source set up like this:    Year Month Headcount  Department 2020 Feb 291 Management 2020 Feb 261 Management 2020 Feb 65 Management 2020 ...
  • v-kelly-msft's avatar
    6 years ago

    Hi PatrickLamoste,

     

    You need a measure as below:

     

    Measure = CALCULATE(SUM('Table'[Headcount ]),FILTER(ALL('Table'),'Table'[Month]=SELECTEDVALUE('Table'[Month])&&'Table'[Year]=SELECTEDVALUE('Table'[Year])-1))

     

    Finally you will see:

    For the related .pbix file,pls click here.

     

    If you wanna use "SAMEPERIODLASTYEAR",you need a calendar table,then get the Month from the date,create a relationship between the 2 tables with column "Month".

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!