Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi, I have this variable
=Max(Month)-1 (this results the number of the previus month)
and I'm trying to calculate the sales of the previous month, but the result is always 0
1 - Sum({<Month={'$(PreviousMonth)'}>}[Sales])
2 - Sum({<Month={$(=Max(Month)-1)}>} [Sales])
Try it with: Sum({<MonthNum={"$(=Max(MonthNum)-1)"}>} [Sales])
than not only the values must be matching the formattings, too. And in general it's recommend to use only numeric fields for such a comparing or any other calculations.
- Marcus
try below
1. vCurrentMonth
=Max(Month)
and make ur expression like:
sum( {$<Year = {$(#vCurrentMonth)}>} Sales )
2. vLastMonth
=Max(Month-1)
sum( {$<Year = {$(#vLastMonth)}>} Sales )
Try it with: Sum({<MonthNum={"$(=Max(MonthNum)-1)"}>} [Sales])
than not only the values must be matching the formattings, too. And in general it's recommend to use only numeric fields for such a comparing or any other calculations.
- Marcus
thanks, that works