Forum Discussion
Changing measures calculations based on Slicers
- Anonymous8 years ago
Thank you. This was helpful.
I created the measures for Previous month using:
Employees Previous Month = CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH))))Employees 2 MonthsBack= CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH))))where the dCalendar is date table and
dCalendar[DimDateKey] refers to the dates in the date table.
Anonymous,
You may take a look at the following post.
Thank you. This was helpful.
I created the measures for Previous month using:
Employees Previous Month = CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH))))
Employees 2 MonthsBack= CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH))))
where the dCalendar is date table and
dCalendar[DimDateKey] refers to the dates in the date table.