DAX Calculation based on Previous Day and a Constant value

@MK3010 Replace DISTINCTCOUNT with SUMX ( DISTINCT ( ‘Storage’[Location] ), 1 ), now your visual runs in ~140 ms

image

compared to DISTINCTCOUNT:
image

The problem is that DISTINCTCOUNT is a non-additive function so for each change in filter context FE ask SE for a separate data cache, and even if each request is executed in 1ms then 1ms * 1475 would be just for DISTINCT Values, with SUMX FE simply ask everything at once and then does DISTINCTCOUNT

5 Likes