Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I want to show values for sales which will have selected month -1 values and without any selection for month will show max month-1 values.
Expression i have used is as below:
sum({<Date={">=$(=Monthstart(addmonths(max(Date),-1)))<=$(=Monthend(addmonths(Max(Date),-1)))"}>}Sales_Derived)
However value is correctly showing without any month or Year selection,
But when i select a Year or month no value is shown.
What could be the issue here?
Thanks
Hello,
Your expression looks good, provided you are using a Master Calendar table rather than an Autocalendar .
I would refine the expression by forcing the format with the function Date as follows (use the format which best suits your timezone)
sum({<Date={">=$(=Date(Monthstart(addmonths(max(Date),-1)), 'M/D/YYYY'))<=$(=Date(Monthend(addmonths(Max(Date),-1)), 'M/D/YYYY'))"}>}Sales_Derived)
I tested on my side and with that tiny change it works fine.
I hope it helps.