Dax explanation please (Max Daily Sales Date)

Hello,

Could someone please explain… in very simple terms, why Max Daily Sales Dates1 yields an incorrect result? The only difference this measure has compared to Max Daily Sales Dates2 is that I am not explicitly using the maxDailySalesAmount variable. I’ve tried to highlight the below to illustrate what I mean. I honestly would have thought these two measures would result in the same, well umm result :slight_smile:

image

Hi @michellepace,

FILTER is an iterator and generates row context. When calling the measure [Max Daily Sales] an implicit CALCULATE is present and context transition takes place.
Context transition is an operation performed by CALCULATE and CALCULATETABLE, it transforms all existing row contexts into an equivalent filter context before applying its filter arguments to the original filter context. For more details see the article below.

Like you’ve already experienced, placing the measure [Max Daily Sales] outside FILTER is enough to make sure that only the current filter context is applied.

I hope this is helpful.

Hi @michellepace, did the response provided by @Melissa help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!