Using CALCULATE to manipulate filters
Often, we want to add to or override the filter context of a value. For that, we have the CALCULATE
function. This is one of the most important functions to learn to pass the exam.
Suppose we want to create a measure that calculates the gross revenue for just our Midwest region. This will allow us to see the Midwest gross revenue. I have created the measure using the Calculate function and added it to the table we saw before.
Notice that our Midwest net revenue is filtered to both Midwest and Product Item Group when in the filter context.
Simple filtering
The Calculate
command syntax is as follows:
CALCULATE (<measure expression>, <filter1>, <filter2>, …)
The first argument in the CALCULATE
function must be an expression that returns a single value. Each filter is separated by a comma. You can have none, one, or...