Microsoft Power BI Complete Reference
by Devin Knight, Brian Knight, Mitchell Pearson, Manuel Quintana
The CALCULATE() function
The CALCULATE() function is the most important function in DAX as it enables the author to modify the filter context under which a measure is evaluated. Regardless of the fields used and filters applied in reports, the filter parameter input(s) to CALCULATE() will be applied. Specifically, the CALCULATE() function will either add a filter to a measure expression (for example, Color = "Red"), ignore the filters from a table or column (for example, ALL(Product)), or update/overwrite the filters applied within a report to the filter parameter specified in CALCULATE().
The syntax of CALCULATE() is the following CALCULATE(<expression>, <filter1>, <filter2>). Any number of filter parameters can be specified including no ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access