Forum Discussion
Anonymous
6 years agoNot applicable
Max calculation using date slicer
I have a calculation that looks for the last date we have in the data and return the value for that date:
Column =
VAR LASTIME = MAX(Query1[ReportDate])
RETURN CALCULATE(VALUES(Query1[OpenInventory]), (Query1[ReportDate]=LASTIME) )
I also have a date slicer on ReportDate but once I change the date range to anything before the max date in the data I get a blank for the calculation. I would like the calculation to pick up the max date on my slicer that I select.
4 Replies
- amitchandakSuper User
Anonymous ,
Have selected Report Date in the slicer. Max should from the date selected in the slicer.
try like
Column =
VAR LASTIME = MAXX(Query1,Query1[ReportDate])
RETURN CALCULATE(VALUES(Query1[OpenInventory]), filter(all(Query1),Query1[ReportDate]=LASTIME) )- AnonymousNot applicable
Thanks amitchandak I tried the following but still receiving a blank once I change the slicer:
Column =VAR LASTIME = MAXX(Query1,Query1[ReportDate])RETURN CALCULATE(VALUES(Query1[OpenInventory]), filter(all(Query1[ReportDate]),Query1[ReportDate]=LASTIME) )- amitchandakSuper User
Anonymous ,Can you share sample data and sample output.
- daxCommunity Support
Hi Anonymous ,
You could refer to my sample for details.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.