Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for some help because I'd like to display on the same line chart :
- Sales of Month M
- Purchases of Previous Month M-1
For that, I've created a dimension Month_Previous = AddMonths(Month,-1)
Then, I though that a measure as followed would have worked : Purchases_Previous_Month = Aggr(sum(Purchases),Month_Previous), if I display the line chart as followed : dimension equals to Month and Measures equal to Sales and Purshases_Previous_Month
But Purchases_Previous_Month displays Purchases. I guess it is a matter of context but I don't know how to handle it.
Hope someone would help me with it !
Thank you !
whats the dimensions you have.
typically you do it like so
your dimension
2 measures
current month - Sum( {<MonthYear={'$(=Max(MonthYear))'}>} LineSalesAmount)
previous month - Sum( {<MonthYear={'$(=Date(AddMonths(Max(MonthYear),-1),'MMM-YYYY'))'}>} LineSalesAmount)