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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jfunderburk
Frequent Visitor

Average is Not Calculating Correctly

Hi all,

 

I have a set of data where I am trying to take an average of orders completed by an employee divided by their hours worked; however, it is not averaging correctly. The order shows the employee's hours on each row of the data, so I believe it is summing each row, when it should be grouping by day. I cannot use a summarize function because it takes away the ability to export the underlying data online.

 

How could I do the average function with a group by the date?

 

Here is a link: https://www.dropbox.com/s/rxlu2cwqd2or3us/Test.pbix?dl=0

 

-Josh

2 REPLIES 2
Phil_Seamark
Microsoft Employee
Microsoft Employee

HI @jfunderburk

 

If I think I understand what you want, you are after an average over the daily average?

 

If so, this calculated measure gets close

 

Alternate Measure = AVERAGEX(ALL('TestData'[date]), DIVIDE(count(TestData[orderid]),sum(TestData[hours])))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil,

 

I don't think an average of a daily average is the correct way to put it. It should be the count of total orders (by order id) divided by the sum of the hours worked.

 

The way the query is set up is to join the hours worked per day to each column, so when it counts the columns all is fine, but when it sums the hours without grouping by date, the formula thinks the employee has worked the hours for the day times the amount of columns.

 

Check out the TestData on my example to see what I mean. 

 

I see two possible solutions: 1. Figure out how to do a "group by" date in the sum function 2. create a new table with employee hours that can have a relationship between both the date and the employee.

 

I uploaded an example with the TestDate and also one where I summarized the data to get the result I want. Remember that the summarized table does not allow me to export the order ids associated to the data, so I am avoiding use it. Link: https://www.dropbox.com/s/rxlu2cwqd2or3us/Test.pbix?dl=0

 

-Josh

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors