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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
samue_an
Helper I
Helper I

Help Required to Calc 2 averages, of different time frames from a Matrix in PBI

Hi All, please can you assist me with some help in DAX, Below I have a very basic data set. I need to either add 2 x Cac Cols or Measures of:

1. The average of the last 3 days

2. The average of last day 10 to last day 4 

 

The DAX I'm trying is below: but stumped honestly:

Last 3 days = CALCULATE(AVERAGEX(VALUES(Query1[4G Data Volume_STD(MB)]), DATESINPERIOD(Query1[Time],LASTDATE(Query1[Time]), -3, DAY)))

 

I need the last 2 columns, colour coded of what the averages must be of

 

samue_an_0-1609789766004.png

 

This is my dataset:

 

samue_an_1-1609789815570.png

 

 

1 ACCEPTED SOLUTION

Thanks so much that has solved my problem, buy understanding and using the Date Table, with its time intelligence

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@samue_an , Try with help from date tbale

Rolling 3 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,Day))


Rolling 10 till 4 Day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date])-4,-6,Day))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks so much that has solved my problem, buy understanding and using the Date Table, with its time intelligence

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.