This post is also available in: Deutsch

Last week, a colleague at work had an interesting question with a customer. This wanted to perform a calculation with CALCULATE, but only on the records of the table where a measure has a certain value. Or in more simple terms, he wants to filter the table by a measure and then perform the calculation on the filtered table.

Measure always requires filter context

A characteristic of measures is that they always require a filter context. To make a simple example, if my measure has the formula Sales Amount = SUM( myTableem[Sales Amount] ), then this formula needs a filter context. Do I want the sales numbers per product or by year? Or maybe by country or by customer? All these issues can be solved with