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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Calculating Rolling AVG 30days in directquery mode

Hi everyone,

 

I am not sure my rolling average calculation is working properly it brings up blank columns in a table

NULLifier_0-1663859716733.png

 

so please may I ask for help with this to see where I am going wrong?

 

I have two tables in directquery mode;

Table1: SPROC Snapshot

Table2: DimTable

I joined DimTable[Date] column on to SPROC Snapshot[ONP DateTime] column to create a 1:many relationship - could this be the issue? that creating a relationship needs to be date only columns (no timestamps).

NULLifier_1-1663860050849.png

 

 

I used the below calculation for Average duration and made a measure:

 

Rolling avg (30days) = CALCULATE(AVERAGEX('SPROC Snapshot', [duration_seconds]),DATESINPERIOD(DimDate[Date] ,LASTDATE(DimDate[Date]) , -30, DAY ))
 
Any help would be appreciated as I am a beginner in creating relationships in PBx
1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @Anonymous ,

Reference the date in the snapshot and not the date table in the DATESINPERIOD and that should work for you.

 

Did I help you today? Please accept my solution and hit the Kudos button.

View solution in original post

1 REPLY 1
davehus
Memorable Member
Memorable Member

Hi @Anonymous ,

Reference the date in the snapshot and not the date table in the DATESINPERIOD and that should work for you.

 

Did I help you today? Please accept my solution and hit the Kudos button.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.