Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
LucianoAnton
New Member

Problems Implementing WINDOW, OFFSET & INDEX functions

So I am trying to learn how to use the new WINDOW, OFFSET & INDEX functions that where released in December as they seem that they could be very useful in a lot of situations, but I just can't get the measures to work. I have read the documentation and watched multiple video tutorials but can wrap my head around how this works behind the scenes.

In this case I am trying to build a rolling total. I am testing this on a simple model with only two tables Date dimension and fact sales. 

LucianoAnton_0-1683824143601.png

 

The only thing I got to work is the very simple example most videos show. Anything more complex then this I cannot get to work properly (my idea was to build a moving average with a variable window size input by the user through a parameter, but I am very far from acheiveing this). 

LucianoAnton_2-1683824951478.png

LucianoAnton_3-1683824984900.png

So up until here it works fine, but of course I don't want to display the data like this (using MonthYearNum), instead I would like to display it with the YEAR and MONTH fields as follows:

LucianoAnton_4-1683825280308.png

The problem there, to my understanding, is that the fields I added are not stated in the [RELATION] table argument and by default are added into the PARTITION argument, explaining why I get the same value in both columns. 


The thing is that the problem persists even if I add these columns to the expressions with the difference that at some apparently random point it starts returning different values, although they aren't the expected values:

LucianoAnton_5-1683825609190.png

Something else I find strange is that if I remove the MONTH field from the visual, it works properly, although I can't acheive the visualization I am looking for. 

 

LucianoAnton_6-1683825780609.png

 

Apparently there are somethings about DAX I still don't quite understand and would like to. Can anybody help me with this and/or provide me with some useful resource to learn both how to use these functions as well as understand what is happening behind the scenes (so maybe some material about how DAX works at a fundamental level). 

I would very much appreciate any help and I thank you all in advanced!

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@LucianoAnton You don't need those functions to build a moving/rolling average. Check out this video for rolling average:

And this one for some of the pitfalls working with the functions you mentioned:

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.