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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
chestern
Regular Visitor

Calculate daily average across months

Hello,

 

I am attempting to calculate the average number of incidents reported per day across the months of September and October, which have 30 and 31 days respectively. I have 25 total incidents which fall on various days during these months (10 in October and 15 in September).

 

I have a pie chart visualization, Drill Down Pie PRO, and a text box which includes a measure for calculating the daily average. When I select one of the months in the pie chart, it correctly calculates the daily average in the text box. For example, if I select September, it correctly calcultes the daily average as 0.5 (15 incidents divided by 30 days).

 

The problem is when I do not select either month. In this case, it incorrectly displays the average as 0.07. It seems like the measure is correctly counting the total number of incidents (25). So, it looks like when I don't select either month, the measure is dividing by 365 days for some reason (25 incidents divided by 365 equals about 0.07). 

 

My measure is count of incident classifications divided by disinct count no blank of the date reported, date. I've experimented with averagex and date tables, but I lack the experience to make this work. I'd greatly appreciate any help anyone can provide. I apologize there isn't a chart or table within this message. Every time I tried to insert a table, my message was flagged as spam.

 

Thank you.

1 ACCEPTED SOLUTION
chestern
Regular Visitor

I just figured it out. I created two measures:

 

Measure = IF(COUNT(Base[Date Reported].[Date])=365, 61, COUNT(Base[Date Reported].[Date]))
Measure 2 = COUNT(Base[Classification]) / [Measure]

View solution in original post

6 REPLIES 6
chestern
Regular Visitor

I just figured it out. I created two measures:

 

Measure = IF(COUNT(Base[Date Reported].[Date])=365, 61, COUNT(Base[Date Reported].[Date]))
Measure 2 = COUNT(Base[Classification]) / [Measure]

This will not work every fourth year, which will have one more day in them. 

 

Why do separate measures?

 

I recommend having an if depending how many months have been selected, ie. diatinctcount( 'Calendar'[Month]) > 2).

 

I hope you are using a separate calendar table?

Gabriel_Walkman
Continued Contributor
Continued Contributor

What should happen when no months are selected?

The textbox should display the average reported incidents per day as about 0.41 (25 incidents divided by 61 days), but the measure is dividing the incidents by 365 days.

chestern
Regular Visitor

Measure = COUNT(Base[Classification]) / DISTINCTCOUNTNOBLANK(Base[Date Reported].[Date])
 
I apologize for all of the replies. I'm trying to escape the spam filter.
chestern
Regular Visitor

ClassificationDate Reported
Incident 19/1/2021
Incident 29/3/2021
Incident 39/5/2021
Incident 49/7/2021
Incident 59/9/2021
Incident 69/11/2021
Incident 79/13/2021
Incident 89/15/2021
Incident 99/17/2021
Incident 109/19/2021
Incident 119/21/2021
Incident 129/23/2021
Incident 139/25/2021
Incident 149/27/2021
Incident 159/29/2021
Incident 110/2/2021
Incident 210/4/2021
Incident 310/6/2021
Incident 410/8/2021
Incident 510/10/2021
Incident 610/12/2021
Incident 710/14/2021
Incident 810/16/2021
Incident 910/18/2021
Incident 1010/20/2021

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.