Forum Discussion
AndySmith
Helper III
2 years agoPrior Period dependent on Month Slicers
Hi I have a sales table and a Date Table. I am using a Month Year Slicer. Would like to calculate the sum of sales for the prior period based on this slicer. So if I have 1 month selected - I...
- 2 years ago
Something like this
you should have a date tableMeasure = VAR CounMonth = DISTINCTCOUNT('Calendar'[Month Number]) RETURN CALCULATE(SUM(yourtable[Sales]), DATEADD('Calendar'[Date],-CounMonth,MONTH))
Ahmedx
Super User
2 years agoSomething like this
you should have a date table
Measure =
VAR CounMonth = DISTINCTCOUNT('Calendar'[Month Number])
RETURN
CALCULATE(SUM(yourtable[Sales]), DATEADD('Calendar'[Date],-CounMonth,MONTH))- AndySmith2 years ago
Helper III
This is perfect. Accepting as solution. Many thanks