Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I having data like below
31-May
30-Apr
31-Mar
28-FEB
31-Jan
Here I need to show the bar chart based on previous month only by default. I dont have date wise data and having only month end level only
-Jai
May be like this
Sum({<Date = {"$(=Date(Floor(MonthEnd(Max(Date), -1)), 'DD-MMM'))"}>}Measure)
Sunny's expression should work but you should consider creating a variable and then referencing that variable in set analysis. That way you can re-use this in other charts or elsewhere in the app.
Another quick tip is to create a universal calendar so that you can look at previous month only (instead of a specific date) but that's not necessary.
To create a variable, I would do this in script as:
Set vLastMonth = Date(Floor(MonthEnd(Max(Date), -1)), 'DD-MMM');
Then in your expression you can simply reference this value.
Sum ( {<Date = {'$(vLastMonth)')}>} Measure)
Perhaps using the Peek function to get the previous month