Forum Discussion
get value for last date
hello all,
For the measure = CALCULATE(SUM(Table[Value]), Table[Name] = "Amount") i get following results:
How can I get the value for the latest existing Calcdate? (in example just want the value 4 for 14.01.2021)
thanks.
5 Replies
- Tahreem24
Super User
Try this below DAx:
CALCULATE(Sum(Table[Value]),FILTER(Table,CalcDate = MAX(CalcDate)))
- Pikachu-Power
Impactful Individual
Thats what I tried first 🙂 I get BLANK then because beside Name = Amount I have other Name`s with CalcDate 19.01.2021. So in your formula MAX(CalcDate) = 19.01.2021 and there no values exist for Name = Amount.
May possibe to Filter only Table[Name] for MAX?
- Tahreem24
Super User
- Pikachu-Power
Impactful Individual
Doesnt work because we have other Names... see my Message 3.
- V-lianl-msft
Community Support
Hi Pikachu-Power ,
In my opinion, there is nothing wrong with the calculation logic. If it is caused by the data model, please provide a sample pbix to let us know your scenario more clearly.
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.