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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
JMG241188
Helper I
Helper I

Need to remove values from dynamic table in DAX percentile Calc

Hey,

 

I have a fomula that is calcualting the percentile of a value, however, I need to remove any row that is equal to "0" as these results should not get a percentile rank and are skewing the rating of the other values.

 

Any help would be greatly appreciated, I'm guessing there needs to be another filter where the Employees[Total Handled Rate 2022] <> 0 but can't seem to figure it out.

 

Formula is below;

 

Total Handled Rate 2022 Percentile =
VAR Adj2022 =
    MIN(Employees[Total Handled Rate 2022])
RETURN
    IF(
        HASONEVALUE(Employees[Code]),
        COALESCE(
            DIVIDE(

                CALCULATE(
                    COUNTROWS(Employees),
                    FILTER(
                        ALLEXCEPT(Employees,Employees[Department]),
                        Employees[Total Handled Rate 2022] > Adj2022
                    )
                ),

                CALCULATE(
                    COUNTROWS(Employees),
                    ALLEXCEPT(Employees,Employees[Department])
                )
            ),
            0
        )
    )
 
Thanks
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @JMG241188 

try like:

Total Handled Rate 2022 Percentile =
VAR Adj2022 =
    MIN(Employees[Total Handled Rate 2022])
RETURN
    IF(
        HASONEVALUE(Employees[Code]),
        COALESCE(
            DIVIDE(
 
                CALCULATE(
                    COUNTROWS(Employees),
                    FILTER(
                        ALLEXCEPT(Employees,Employees[Department]),
                        Employees[Total Handled Rate 2022] > Adj2022&&Employees[Total Handled Rate 2022] <> 0
                    ),
                ),
 
                CALCULATE(
                    COUNTROWS(Employees),
                    ALLEXCEPT(Employees,Employees[Department]),
Employees[Total Handled Rate 2022] <> 0
                )
            ),
            0
        )
    )

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @JMG241188 

try like:

Total Handled Rate 2022 Percentile =
VAR Adj2022 =
    MIN(Employees[Total Handled Rate 2022])
RETURN
    IF(
        HASONEVALUE(Employees[Code]),
        COALESCE(
            DIVIDE(
 
                CALCULATE(
                    COUNTROWS(Employees),
                    FILTER(
                        ALLEXCEPT(Employees,Employees[Department]),
                        Employees[Total Handled Rate 2022] > Adj2022&&Employees[Total Handled Rate 2022] <> 0
                    ),
                ),
 
                CALCULATE(
                    COUNTROWS(Employees),
                    ALLEXCEPT(Employees,Employees[Department]),
Employees[Total Handled Rate 2022] <> 0
                )
            ),
            0
        )
    )

Hey, thanks for the response, I'm getting an error of;

 

"Argument '3' in CALCULATE function is required.

just had to remove the comma after the bracket, thanks for your help

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.