Forum Discussion
giorajo
5 years agoHelper I
Always Displaying Same Value
I got a matrix displaying the name of clients in the rows and the sales per month on the column. I got a Year slicer for this matrix. I have a measure that gets the December sales of th...
- 5 years ago
Hi giorajo
Try this code
Total Sales = CALCULATE(SUM(Sales[Sales])) Sales Rel to Prev Dec = VAR __PrevYear = YEAR ( MAX ( DateTab[Date] ) ) - 1 VAR __PrevDec = CALCULATE ( [Total Sales], DATESBETWEEN ( DateTab[Date], DATE ( __PrevYear, 12, 1 ), DATE ( __PrevYear, 12, 31 ) ) ) RETURN CALCULATE ( DIVIDE ( [Total Sales], __PrevDec ), 0 )2019 (vs Dec 2018)
2020 (vs Dec 2019)
Hope this helps
David
Ashish_Mathur
5 years agoSuper User
Hi,
Share the link from where i can download your PBI file.