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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
crisher
Helper I
Helper I

Daily Average In a Matrix

I am trying to create a daily average in a matrix where the denominator dynamically updates to the number of days in the month based on the filter context of that row's day. So, in the matrix below, there would be a daily average column at the end that would be different each day based on the previous day's billings and an additional day being added to the denominator.

 

crisher_0-1642179800809.png

The calculation would reset at the beginning of each month. I think it is similar to the following. Obviously, this is a rolling 14 day average.

 

Daily Average 2 = calculate(
'Billing Stats Productivity AZB'[Billing Total],
DATESINPERIOD('Calendar'[Date],LASTDATE('Calendar'[Date]),14,DAY)
)/14
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I'd recommend using AVERAGE or AVERAGEX instead of trying to calculate the denominator.

 

For example, this averages over each date in the current month up to the current one:

MTD Daily Average =
AVERAGEX ( DATESMTD ( 'Calendar'[Date] ), [Billing Total] )

 

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

I'd recommend using AVERAGE or AVERAGEX instead of trying to calculate the denominator.

 

For example, this averages over each date in the current month up to the current one:

MTD Daily Average =
AVERAGEX ( DATESMTD ( 'Calendar'[Date] ), [Billing Total] )

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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