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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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

@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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.