Forum Discussion
Total Sales Variation Same Period Last Year
- Anonymous4 years ago
Anonymous
To get the both last year value with slicer, you would need to create a distinct year table as the slicer.1. Create a new table:
Slicer table = Distinct(Calendar[Year])
2. Create the 3 measures:Total Sales = SUMX( Sales, Sales[Total])
Total Sales Same Period Last Year = CALCULATE([Total Sales], FILTER('Calendar', 'Calendar'[Year]=SELECTEDVALUE('Slicer table'[Year])-1),SAMEPERIODLASTYEAR('Calendar'[Data]))
Variation Last Year % = divide([Total Sales]-[Total Sales Same Period Last Year],[Total Sales],0)
Best regards
Paul Zheng _ Community Support TeamIf this post helps, please Accept it as the solution to help the other members find it more quickly.
I want to ask you: what's the point of this part: "...'Calendar'[Year]=MAX('Calendar'[Year])-1...", cause I understand that the SAMEPERIODLASTYEAR already take the last year.
Thanks a lot.