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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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