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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rcarrinsp
Frequent Visitor

Average of Count per Hour over a date range using only a specific day of the week

Hello,

 

I'm having trouble with the DAX formula to generate the average of the counts over a period of time.

 

As you can see by this screenshot, the AVERAGE comes out to be the same as the COUNT.

 

Dashboard.jpg

 

 This is the formula I'm using:

 

Average Formula.jpg

 

but, I've tried multiple varations of it:

 

1.

AVERAGEX(
KEEPFILTERS(VALUES('Incident'[OwnedByTeamAssignedTimeHour])),
(COUNTA('Incident'[OwnedByTeamAssignedTimeHour]))
)

 

2.
CALCULATE (
DIVIDE ( [Total Tickets], DISTINCTCOUNT ( Calendar[WeekID] ) ),
FILTER (
ALL ( calendar ),
calendar[WeekID]
>= MAX ( calendar[weekID] ) - 12
&& calendar[WeekID] <= MAX ( calendar[WeekID] )
),values(calendar[day])
)

 

3.
AVERAGEX(
SUMMARIZE(
Incident,
Incident[OwnedByTeamAssignedTimeHour],
"Count",
COUNT('Incident'[OwnedByTeamAssignedTimeHour])
),
[Count]
)

 

They all just produce the COUNT.

 

Additional info:  I took the DATE/TIME field, and split out the Date and Time, and then I rounded the TIME, so that I could COUNT how many tickets came in during that time, so my data looks like this:

 

DATE SAMPLES.jpg

 

Anyone have an idea of why I'm not able to generate the actual AVERAGE?

 

Thanks in advance for your help!

 

RC

1 ACCEPTED SOLUTION

OK, so the top visual is correct then? And in the bottom visual, you want to see the AVERAGE per day for each hour for the selected date range in the slicer above? Are those all correct statements?

 

If those are all correct statements, you could do a COUNTROWS of your calendar table (if your slicer is based upon that) and use that as your denominator.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

12 REPLIES 12

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.