Forum Discussion
Newbie with a problem understanding code.
- Anonymous2 years ago
Hi, peraleonardo
Thank you very much for your reply. This is true if you intend to take all dates into account in your calculations without taking into account any filters applied elsewhere in the report.
ALL ( 'table'[date])However, if you wish to keep some filters, you may need to adjust this part of the formula. You should try using ALLEXCEPT to keep the other filters in your matrix.
ALLEXCEPT function (DAX) - DAX | Microsoft Learn
KEEPFILTERS function (DAX) - DAX | Microsoft Learn
It would be helpful if you could make some virtual data and describe the output that you are looking forward to, it would help me understand your problem.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The MAX function in the code will automatically calculate the maximum date outside the corresponding date range.
xx = Calculate (
Sum('table'[y]),
FILTER
( ALL ( 'table'[date]),
'table'[date] = MAX('table'[date]) && 'table'[date] <= TODAY()
))
Not quite sure if I misunderstood your question.