From the course: Mastering Business Intelligence with DAX, Power BI, and Excel by Microsoft Press

Unlock this course with a free trial

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

Use PARTITIONBY and MATCHBY

Use PARTITIONBY and MATCHBY

- In the previous video, you've got to know Windows functions like index, offset and window. And you've seen how these functions return tables based on the base table and a current row or current context on that table. In this video, we dive into a couple of additional options to be used with these window functions. So far you've seen examples of window functions on the base table and with relative or absolute pointers. You can select a single row or a range of rows from that table. The partition by function allows for more fine tuned selection of rows from the base table. So what this function does is two things basically. First, it chops up the table in partitions, and second, it determines which partition the current row or current context is in. And then it will apply the pointers relative to that current partition. And the partition by function allows you to define how the partitions are defined. Let's look at…

Contents