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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Removing an outlier from daily revenue to create average daily revenue over 30 days

I have a table that totals our daily revenue with a date. I use the following formula to give me a avg daily revenue over 30 days.

However because February only has 28 days, the last day in February included the payments for what would be the 29th, 30th and 31st of normal months, essentially we got up to 4 days of payments into one so it is artificailly making the average higher than it should be. Is there an easy way to solve this problem? Thanks in advance! 

date_actualSum of Total
20-Feb-22$31,788.02
21-Feb-22$33,750.21
22-Feb-22$31,569.05
23-Feb-22$32,070.29
24-Feb-22$34,994.32
25-Feb-22$35,119.62
26-Feb-22$33,230.44
27-Feb-22$36,018.30
28-Feb-22$96,210.87
1-Mar-22$25,788.40


 
 
1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Anonymous you can create a new measure like below

 

New_Total =

var YearStartDate = DATE('Table'[date_actual].[Year],1,1)
var YearEndDate = DATE('Table'[date_actual].[Year],12,31)
var TotalDays = (YearEndDate - YearStartDate) + 1
var IsLeapYear = IF(TotalDays = 366,"Yes","No")
return
if ( and (TotalDays=365,'Table'[date_actual].[Date]=DATE(year(YearStartDate),2,28)),'Table'[Sum of Total]/3,
if ( and(TotalDays=366,'Table'[date_actual].[Date]=DATE(Year(YearStartDate),2,29)),'Table'[Sum of Total]/2,
'Table'[Sum of Total]))
 
negi007_0-1646234428970.png

let me know if this method helps you. You can customize your average formula as well 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

4 REPLIES 4
negi007
Community Champion
Community Champion

@Anonymous you can create a new measure like below

 

New_Total =

var YearStartDate = DATE('Table'[date_actual].[Year],1,1)
var YearEndDate = DATE('Table'[date_actual].[Year],12,31)
var TotalDays = (YearEndDate - YearStartDate) + 1
var IsLeapYear = IF(TotalDays = 366,"Yes","No")
return
if ( and (TotalDays=365,'Table'[date_actual].[Date]=DATE(year(YearStartDate),2,28)),'Table'[Sum of Total]/3,
if ( and(TotalDays=366,'Table'[date_actual].[Date]=DATE(Year(YearStartDate),2,29)),'Table'[Sum of Total]/2,
'Table'[Sum of Total]))
 
negi007_0-1646234428970.png

let me know if this method helps you. You can customize your average formula as well 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

This worked liked a charm, thank you! 

amitchandak
Super User
Super User

@Anonymous , you can check and divide

example

if(day(eomonth(max(date[Date]),0)) in {28,29} , [Sum of Total]/4, [Sum of Total])

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
Anonymous
Not applicable

Thank you for that. Im still a little confused but what is the best way to incorporate it. Here is my formula.

 
Avg Daily Revenue Over 30 Days = CALCULATE (
SUM (dim_date[amount]),
DATESINPERIOD( dim_date[date_actual], TODAY() -1, -30, DAY )
) / 30

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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