From the course: Power BI Weekly

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Consolidating DAX formulas

Consolidating DAX formulas - Power BI Tutorial

From the course: Power BI Weekly

Consolidating DAX formulas

- [Jennifer] When we're building DAX measure calculations, we might want to create them separately in order to check that each piece works. Once we confirm our calculations, let's say that we want to move them into a single formula. To do so, the approach I take is to create variables with the same measure names in the consolidated formula, replace the original measure formulas with a placeholder result, and once everything works, we can then delete the original measures. We have distance calculations between a selected origin city and destination cities as measure formulas in either kilometers or miles. Let's choose the calculation for kilometers, which will copy and duplicate to calculate a new measure that will call distance. This formula takes the measure R and multiplies it by the measure C. If we look at the formulas for these measures, the value of R is a fixed constant for the earth's radius. Let's create another variable within R distance measure called R, which will set…

Contents