Forum Discussion
paulpassot
4 years agoFrequent Visitor
Filter context weirdness
Hi there! Perhaps a newbie question, but I can't wrap my head around how a measure reacts to filters... I have a measure that calculates sum of sales for the most recent day in the data : ...
- 4 years ago
paulpassot
Aparently this is Auto-Exist problem.First step try to manually calculate the last day sales. If it does not match the result of my first solution then you need to have a date table that filters your data set. This will totally eleiminate the problem.
tamerj1
4 years agoCommunity Champion
Hi paulpassot
please try
Max Day Sales =
VAR MaxDate =
CALCULATE ( MAX ( Invoices_LQ[PostDate_DateFormat] ), REMOVEFILTERS () )
RETURN
CALCULATE (
SUM ( Invoices_LQ[InvoiceLine.Amount] ),
Invoices_LQ[PostDate_DateFormat] = MaxDate,
REMOVEFILTERS ()
)paulpassot
4 years agoFrequent Visitor
Hi, thanks for the quick reply!
Interestingly, it gives the same result across dates (which is good), but it doesn't seem to give the right number:
I would expect 4,744$, not 5,358$.
I understand the logic of your code though, and I can't figure out how it comes up to 5,358$