Forum Discussion
Cyriackpazhe
1 year agoHelper III
DAX
Why do i get different result on adding and removing the calculate in the Variable First. Which is the correct one when i want to compute the sales amount of first day of sales of the p...
johnt75
1 year agoSuper User
CALCULATE forces context transition. SUMX is an iterator which introduces a row context over the Products table, but the row context will not affect the filter context, so when you are getting the min sales date without CALCULATE you are getting the min sales date of all products, so the first ever sale.
When CALCULATE performs context transition the row context from the Products table is turned into a filter context, which means that the sales table is filtered to only sales for that individual product. At that point the min sales date is the first sale date for that specific product.