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
SarikaKumari18
Helper III
Helper III

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
Super User
Super User

@SarikaKumari18 TRIMMEAN - Microsoft Power BI Community


@ 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

6 REPLIES 6
SarikaKumari18
Helper III
Helper III

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

@SarikaKumari18 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.

 


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

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

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

Greg_Deckler
Super User
Super User

@SarikaKumari18 TRIMMEAN - Microsoft Power BI Community


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

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
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.

Top Solution Authors