Forum Discussion

StilHopen's avatar
StilHopen
Frequent Visitor
4 years ago
Solved

Percentile using counts

I have found that to get percentile for counts based off day/hour I have needed to group by days or hours and do the counts in advance of doing the percentile calc or it would not work.  Is there a better way to do this so that slicers will work or do I just have to create tables for each percentile slicer?

 

IE:

a table with multiple events on a day and I need to see the counts per day and per hour.(date and hour are already split out to their own columns).

 

Hopefully this makes sense, but it just seemed weird that average/mode/median work great, but percentile doesn't behave the same way.

  • NeverMind, found my own solution as it was just a typo that I couldn't help but recreate everytime.  I blame temporary insanity.
     
    What the end result looked like:
    Calc 90th =
    PERCENTILEX.INC(
        KEEPFILTERS(VALUES('Table'[DateTime])),
        CALCULATE(COUNTA('Table'[ID#])), 0.9
    )

3 Replies

  • Everything is always based on filter context, especially when it comes to implicit measures. Don't like that?  Write explicit measures. That will allow you to define the scope for your percentiles (with the option to override the filter context)

  • StilHopen's avatar
    StilHopen
    Frequent Visitor
    NeverMind, found my own solution as it was just a typo that I couldn't help but recreate everytime.  I blame temporary insanity.
     
    What the end result looked like:
    Calc 90th =
    PERCENTILEX.INC(
        KEEPFILTERS(VALUES('Table'[DateTime])),
        CALCULATE(COUNTA('Table'[ID#])), 0.9
    )