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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
MartyR
New Member

Rolling Average w/ Multiple Entries Per Date

Hi all.  Still very much a beginner at DAX so any help would be much appreciated.  I'm trying to get a rolling average of Product Distribution, but when I use the DAX codes I can find online for rolling averages, it creates an error as the date column contains duplicate dates.  The code I'm trying to use is;

 

Product X Rolling 4Wk =
VAR NumDays = 28
VAR RollingSum =
CALCULATE(
SUM('Raw Data'[Product X In Store?]),
DATESINPERIOD('Raw Data'[Call Date],LASTDATE('Raw Data'[Call Date]),-NumDays,DAY)
)
RETURN
RollingSum/NumDays

 

Example of type of data is as follows.  We show this as weekly average % distribution currently, but client has requested visibility of 4 week rolling average.

 

Call DateStore NameProduct X In Store?
06/09/21Store A1
06/09/21Store B0
06/09/21Store C0
07/09/21Store D1
07/09/21Store E1
07/09/21Store F1
08/09/21Store G0
08/09/21Store H1
08/09/21Store I0

 

Any help would be greatly appreciated!

2 REPLIES 2
MartyR
New Member

Thanks, and great to know it's doable.  Will give that a go!

Schmidtmayer
Helper II
Helper II

Just create a table with unique date values and establish a connection between your initial table and your newly created dates table. Then change your measure to the date column of the newly created dates table. You may use CALENDARAUTO function (DAX) - DAX | Microsoft Docs for that.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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