Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Dynamic Percentiles

Hello community,

 

I have the below dataset that has grades from students in each department. I want to calculate percentiles (p25, p50, p.75) for all students but also when I filter with slicer the Department I want to see the percentiles for that category only.

IDDepartmentGrade
1A7
2A8
3A6
4A5
5A8
6A9
7A6
8B4
9B3
10B5
11B6
12C7
13C8
14C6
15C5
16D6
17D7
18D6
19D5
20D10

 

Many thanks!

  • Hi Anonymous ,

     

    You can try below formula:

    M_0.25 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.25 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )
    M_0.5 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.5 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )
    M_0.75 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.75 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )

    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Anonymous ,

     

    You can try below formula:

    M_0.25 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.25 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )
    M_0.5 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.5 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )
    M_0.75 =
    CALCULATE (
        PERCENTILE.EXC ( 'Table'[Grade], 0.75 ),
        ALLEXCEPT ( 'Table', 'Table'[Department] )
    )

    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.