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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Need help to calculate average resolution time which excludes top and bottom 1% of values

Hi all,
I need to calculate average of resolution time which should exclude 1% extreme values means top and bottom 1% values.
Average of resolution time= (Resolved On Date - Created on Date) divided by total number of ticket count
So if I have 1000 resolved ticket , we should exclude the 10 tickets that have the shortest resolution time and the 10 tickets that have the longest resolution time.

I have tried using RANKX function to calculate top and bottom rank on resolution time(difference between resolved and created) but not able to get it right and also, how do I combine both top and bottom in final query.

TopRANK = RANKX (table,table[ResolutionTimeInHr])

BottomRANK = RANKX (table,table[ResolutionTimeInHr],,ASC)

 

Top 1% =
var top_find_rank=COUNTROWS (Table) * 0.01
RETURN COUNTROWS(FILTER(Table,Table[TopRank]<=top_find_rank))

I see one more issue with Rank here is when I apply date filter then also the rank value is static. it should change dynamically as and when we choose date slicer

I had referred this link https://www.burningsuit.co.uk/blog/best-and-worst-two-approaches-finding-top-or-bottom-n-percent-usi... but I am still stuck.

It would be great if someone can help or guide on this . Please let me know if anything is not very clear .
Thanks much in advance !
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous TRIMMEAN - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Greg_Deckler  I don't want to disturb original fact table as we have other business logic to be applied on whole data. Is it possible to achieve this without introducing another fact table ?

@Anonymous It's a measure. Shouldn't introduce another fact table, just need to use it against your current table. If you post sample data, I can be more specific.

 



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler My bad just realized its measure in your pbix file , actually I have been trying with tables/columns/measure and it is still throwing an error .
Here is the sample excel file with data  Sample file 
Its throwing an error at Value at the end . It would be great if you can help on this
Thanks much !

Anonymous
Not applicable

@Greg_Deckler Its working amazingly . Thanks a lot for all your effort and great work 🙂

Greg_Deckler
Community Champion
Community Champion

@Anonymous TRIMMEAN - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks very much Greg @Greg_Deckler  !
I am going through the detailed solution and it will take a while for me to understand how the solution is working and apply the same logic in my data model. 
I see here we are using calculated table and not sure if we can get rid of this and do it using just column/measures or we have any simpler solution to this . 
Thanks again for your help ! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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