Forum Discussion
Tito
Helper IV
2 years agoMAX-Formula
Hello, I have a problem with the MAX formula. In my example, I want to calculate a sum of sales with maximum of date only for group A. And for group B I calculate the sum of sales without the maximu...
- 2 years ago
Hello,
I have solved the problem with the following DAX function.
Thank you very much for your support.
Tito
Helper IV
2 years agoThank you for your help.
But when I add the date to the matrix, it doesn't show correctly.
Dangar332
Resident Rockstar
2 years agoHi, Tito
try below
result =
var a = CALCULATE(MAX(tebelle1[date]),KEEPFILTERS(tebelle1[group]="a"),ALLEXCEPT(tebelle1,tebelle1[group]))
var b = CALCULATE(SUM(tebelle1[sales]),FILTER(tebelle1,tebelle1[date]=a))
var c = CALCULATE(SUM(tebelle1[sales]),KEEPFILTERS(tebelle1[group]="b"))
return
b+c
- Tito2 years ago
Helper IV
Thanks for the further help.
When I select "A" or "B" from the filter, the correct result comes up. But if I do not use the filters, the correct result does not come.