What is Calculate Function in Power BI DAX | Use of Power BI DAX CALCULATE

Опубликовано: 10 Октябрь 2024
на канале: PowerBI Zone
4,515
126

#powerbidax
#powerbidaxfunction
#powerbi
#powerbitraining
#powerbizone
This video explains the viewers about the usage of the Power BI DAX function called "CALCULATE".
Its syntax is : CALCULATE(expression[, filter1 [, filter2 [, …]]])
Note: This is the most important and useful function in DAX.
Use of Power BI DAX CALCULATE :CALCULATE is a function that creates a new Filter Context
Every filter argument can be either a filter removal (such as ALL, ALLEXCEPT, ALLNOBLANKROW,REMOVEFILTERS),
a filter restore (ALLSELECTED), or a table expression returning a list of values

Return value :The value that is the result of the expression.
Remarks
When filter expressions are provided, the CALCULATE function modifies the filter context to evaluate the expression. For each filter expression, there are two possible standard outcomes when the filter expression is not wrapped in the KEEPFILTERS function:

If the columns (or tables) aren't in the filter context, then new filters will be added to the filter context to evaluate the expression.
If the columns (or tables) are already in the filter context, the existing filters will be overwritten by the new filters to evaluate the CALCULATE expression.
The CALCULATE function used without filters achieves a specific requirement. It transitions row context to filter context. It's required when an expression (not a model measure) that summarizes model data needs to be evaluated in row context. This scenario can happen in a calculated column formula or when an expression in an iterator function is evaluated. Note that when a model measure is used in row context, context transition is automatic.

This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
For more details: https://docs.microsoft.com/en-us/dax/...

You can download the pbix file used in this video from here .Please view it in Power BI desktop.
Link: https://drive.google.com/file/d/1HmXD...