It’s always a best practice to avoid filtering an entire table if the filter condition involves only some of the table columns (i.e. when no key/unique columns are used in the condition expression).
It’s always a best practice to avoid filtering an entire table if the filter condition involves only some of the table columns (i.e. when no key/unique columns are used in the condition expression). The way to go is to only filter the columns involved in the condition (using Filter over All, Values or Distinct applied to the desired columns), and use those filter results as parameters to Calculate to carry out the rest of the computation.
Example:
=Calculate(CountRows(FactInternetSales), Filter(Values(FactInternetSales[OrderDateKey]), [OrderDateKey] <= Min(DimDate[DateKey])))
Note: Posted by Vidas Matelis based on information received from Marius Dumitru.
Tags: performance, tip