From the course: Advanced Power BI: DAX Language, Formulas, and Calculations

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

CALCULATE DAX function

CALCULATE DAX function

- [Instructor] CALCULATE is an incredibly powerful and useful function in creating DAX measures. It lets us add conditional logic to our calculations, much like we would in Excel functions like SUMIFS or COUNTIFS. The CALCULATE function consists of two input parameters. Let's explore the second parameter first because we want to think about filtering the data before we perform a calculation on it. We can have as many filters as we would like in the formula and we can apply filters against several fields in the data tables. The first parameter in the CALCULATE function is the aggregate calculation we're performing over the filtered rows, which themselves can be DAX measures or fields inside aggregate functions like SUM or AVERAGE. But it cannot be a naked column without an aggregation. It's important to keep everything in perspective when you're creating a DAX measure. The logic behind creating DAX measures is much harder…

Contents