Forum Discussion
PatrickLamoste
6 years agoHelper I
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 ...
- 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,
KellyDid I answer your question? Mark my post as a solution!
v-kelly-msft
6 years agoCommunity Support
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
Kelly
Did I answer your question? Mark my post as a solution!