## Evaluation Context in DAX

###### How to understand Evaluation context in DAX?

Evaluation context is a very important concept one need to understand while writing the DAX
formulas.
It plays an important role while evaluating the formula. The result of the DAX formula
will be directly dependent on the evaluation context it is evaluated.
This means the result will be
different in different contexts even if the formula used is same.

## SUMX in DAX

Sumx is the x version of the SUM function, this function takes two parameters.

The first parameter is a table name or any function which returns a table. And the second parameter is an expression to evaluate while this can be a column that need to be aggregated.

This function creates a row context in the given table and iterates over each row and evaluates the expression in the table.

## ALLSELECTED in DAX

ALLSELECTED

ALLSELECTED is a function that is useful when you want to perform calculations using filters as parameters. Especially this function is very useful for Percentage calculation on parents.

## How to use CALCULATE in DAX?

CALCULATE IN DAX

This article shows How to understand CALCULATE function in DAX. Calculate is one of the powerful functions in DAX language. This function will be a substitute for Excel’s SUMIF, COUNTIF, AVERAGEIF or ANYTHINGIF in reality. You can perform any kind of complex aggregate calculations using CALCULATE function.

## Calculating Percentage on Hierarchies in DAX

DAX does not allows us to calculate hierarchies directly. In fact there’s no DAX function that handles hierarchies. But we can calculate them using some tricks. In this article, I am going to explain how we can calculate percentages on a geographic data.

We have some of the following natural hierarchies in the database world.