In the first two articles in this series on creating DAX formulae, Andy Brown of Wise Owl Training showed how to create calculated columns and measures. In this third article, he turns his attention to two of the most important DAX functions (CALCULATE and VALUES), showing how and when to use them. If DAX knowledge can be compared to a heavily fortified castle, the CALCULATE function is the drawbridge giving access to it.
In the first article in this series, Andy Brown demonstrated how to create calculated columns in Power BI using the DAX language. This second article in the series explains what measures are, and how you can use DAX to create measures within Power BI. The formulae in the article apply equally well to PowerPivot and Analysis Services Tabular Model.
In part 1, we described the requirements for calculating attrition and also demonstrated one method that doesn’t rely on writing DAX code at all. In the second part of this tip, we introduce alternative methods of creating a calculation in DAX to calculate the number of employees that have left the company.
In many businesses, the HR department needs reports on the employee attrition. This is the number of people that leave the company (depending on the reason they leave; the terminology can also be dismissals or turnover). Suppose you have a table with your employee data, where you also store a possible termination date. How do you calculate the number of people who have left the company using the DAX query language?