Window Functions in the Model

Steven Talbot · Friday Demos · November 13, 2026 · 2:52

How window functions can be defined as measures in a model, with examples of running totals, lagged totals, partitioned calculations, and rolling windows. It demonstrates how the measures…

Try it yourselfThe full week on docsfunctionsmodelingwindowworkbook

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. Okay, I'll demonstrate a new functionality in the model, namely window functions, which are essentially measures that work like window functions. So, you see a few of them that I've already set up in my model. I have a rolling total that implicitly ends at the current element, or as you might say, at the current slice. This one ends on the previous cut.

  2. Here you see the breakdown, and here is the data for the last three months. Here you have the average without ordering. So, it's just a split that covers the entire window. These are just a few examples. You can see them in action, and they work even if they don't have the dimensions they rely on, because they are pulled up using the required fields mechanism.

  3. They pull up the data they depend on . Here you see that the value with lag one is shifted one step back. If we add this element broken down by gender, it will automatically pull up the gender field. And often you'll probably want to— maybe we'll add a feature for that— do a summary. Now, after the erection, the breaking up occurred naturally.

  4. And if we want, here's the one that's calculated for the period. Uh ... you see it covers the last three months. And where did the general one go? Oh , yes, this one is broken down by country for the entire window. It turned out a little...but so you can see, uh ... they are, of course, artificially created.

  5. Er... but yeah, they just tighten up the fields they're based on. Currently, they can only be manually entered into the model. The ability to define them in a workbook will be available soon. Here is their little workbook. Right now you see them in the book just like that, but it will soon become more convenient. They will be editable in the workbook as a special field.

  6. Oh, and they often ask: is it possible to convert calculations into such indicators? Not yet . Of course, Excel and this language have a lot in common, but finding exact matches and determining what exactly can be converted is still in the works. Okay, that's all.