From the course: Microsoft Power BI Data Analyst Associate (PL-300) Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Use the CALCULATE function

Use the CALCULATE function

- [Instructor] In this sub lesson, we are going to use the CALCULATE function. So first a little bit about the CALCULATE function. It is used to alter the filter context. It does so by creating a new filter context and evaluating an expression in that context. The generic syntax is the CALCULATE function, followed by an expression, and then any number of filters after that. So let's go out to the Power BI Desktop and take a look. Okay, so in this particular model here, what I'm going to do is go to my InternetSales table and let's just go ahead and take a look at our Total Sales SUMX function. So really nothing too surprising here. We've seen this function before, basically going through the InternetSales table on a row by row basis and accumulating the multiplication of the UnitPrice and the OrderQuantity. So really nothing too surprising going on here. So we can go ahead and take a look at the Total Sales SUMX on the visual, and when we go and apply that, basically, this function…

Contents