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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Coryanthony
Helper III
Helper III

Top 4 Average

Hello All,

I want to find the average audits per hour for the top 4 Auditors. I have my average Audits per hour. Please help

 

Line Items Actioned = COUNT('All Actioned'[Report Legacy Key])

Line Items Audited = CALCULATE([Line Items Actioned], 'All Actioned'[Selected for Audit] = 1)

Total Hours = SUM('Time Utilization'[Hours])

Hours Audit = CALCULATE([Total Hours], 'Time Utilization'[Stage] = "F&A-TE-Audit")

Hourly Audit = DIVIDE([Line Items Audited], [Hours Audit] ) 

Coryanthony_0-1701959939041.png

All Actioned and Time Utilization table does not have a direct relationship. Both tables has a relationship with Calendar and Auditor Names Table.

Coryanthony_1-1701959996156.png

 

Coryanthony_2-1701960009120.png

 

Thank you for your time.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Coryanthony , Try meausre like

Calculate([Hourly Audit], keepfilter(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))

 

I do not think you need another avg as divide is avg only or try

 

 

Calculate(averaged(values('All Actioned'[Auditor]) , [Hourly Audit]) , keepfilter(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))

Power BI: rankx, topn, dynamic topn with numeric parameters
https://youtu.be/cN8AO3_vmlY?t=25620

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@Coryanthony , Try meausre like

Calculate([Hourly Audit], keepfilter(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))

 

I do not think you need another avg as divide is avg only or try

 

 

Calculate(averaged(values('All Actioned'[Auditor]) , [Hourly Audit]) , keepfilter(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))

Power BI: rankx, topn, dynamic topn with numeric parameters
https://youtu.be/cN8AO3_vmlY?t=25620

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

Your youtube video really helped me with this one. Thank you,

= CALCULATE([Hourly Audit], TOPN(4,ALLSELECTED('Auditor Names'[Auditor]),[Hourly Audit],DESC), VALUES('Auditor Names'[Auditor])).




@amitchandak 

This one seem to work but appears to be inaccurate.

 

Top 4 Auditors = Calculate(AVERAGEX(VALUES('All Actioned'[Auditor]),[Hourly Audit]), KEEPFILTERS(TOPN(4,ALL('All Actioned'[Auditor]),[Hourly Audit],DESC)))

 

Coryanthony_1-1702067283365.png

 

 

Hi,

Does this measure work?

=DIVIDE(SUMX(TOPN(4,VALUES('All Actioned'[Auditor]),[Hourly Audit],DESC),[Hourly Audit]),4)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur Thank you for your response.

It does not appear to accurate.
Top 4 Auditors sample = DIVIDE(SUMX(TOPN(4,VALUES('All Actioned'[Auditor]),[Hourly Audit],DESC),[Hourly Audit]),4)

 
Top 4 Auditors = Calculate(AVERAGEX(VALUES('All Actioned'[Auditor]),[Hourly Audit]), KEEPFILTERS(TOPN(4,ALL('All Actioned'[Auditor]),[Hourly Audit],DESC)))
 
Coryanthony_0-1702228469527.png

 

 I'd like to see the Average for the top 4 auditors with the highest [Hourly Audit]. For October, the top auditors were Operator 23, 21,38 and 29. I'd like to see their average. 
If i can get their average, this would be the team hourly goal. Thank you
 
 

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you @Ashish_Mathur 

 

i was able to get the right measure - 

= CALCULATE([Hourly Audit], TOPN(4,ALLSELECTED('Auditor Names'[Auditor]),[Hourly Audit],DESC), VALUES('Auditor Names'[Auditor]))

Hey @amitchandak 

Thank you for your response. It appears i am getting an error.

First -  Calculate([Hourly Audit], keepfilters(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))
Results: The syntax for ',' is incorrect. (DAX(Calculate([Hourly Audit], KEEPFILTERS(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc)))).

Second - 

Top 4 Auditors = Calculate(AVERAGE(values('All Actioned'[Auditor]) , [Hourly Audit]) , KEEPFILTERS(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc))


Results: The syntax for ',' is incorrect. (DAX(Calculate(AVERAGE(values('All Actioned'[Auditor]) , [Hourly Audit]) , KEEPFILTERS(TOPN, 4, ALL('All Actioned'[Auditor]),[Hourly Audit], desc)))).


 

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors