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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Saloni_Gupta
Helper I
Helper I

Calculate Quartile 1 based on user selection

Hi All,

I have a requirement to calculate Percentile (Quartile1) for all the employees in same Line of Business and at same management level (peer) for a metric (Utilization) when filtered on a particular Employee name (consider its LineofBusinessLinkKey when filtered on a particular employee) as shown below:

Saloni_Gupta_1-1737996269503.png

So, in the above screenshot, If user selects Amar, then calculate Quartile 1 for the utilization values for Consulting:Senior Associate.

this is my dax

Utilization - 25th Quartile =
var selectedemployeeloblinkey = CALCULATE(MAX('Employee Info'[LineofBusinessLinkKey]),'Employee Info'[Full Name] = SELECTEDVALUE('Employee Info'[Full Name]))
VAR FilteredData = ALLEXCEPT('Employee Info','Employee Info'[Employee Id])
var LoBQuartile1 = PERCENTILEX.INC(FilteredData, CALCULATE([Utilization],'Employee Info'[LineofBusinessLinkKey] = selectedemployeeloblinkey),0.25)
RETURN LoBQuartile1

I am not sure what is wrong with this dax but not getting results because of the expression :CALCULATE([Utilization],'Employee Info'[LineofBusinessLinkKey] = selectedemployeesubloslinkey).

Can you please help correct the dax. Thanks in Advance!



1 REPLY 1
Anonymous
Not applicable

Hi @Saloni_Gupta 

Please try the following Dax:


Utilization - 25th Quartile =
VAR SelectedEmployeeName = SELECTEDVALUE('Employee Info'[Full Name])
VAR SelectedEmployeeLOB =
    CALCULATE(
        MAX('Employee Info'[LineofBusinessLinkKey]),
        'Employee Info'[Full Name] = SelectedEmployeeName
    )
VAR Peers =
    FILTER(
        ALL('Employee Info'),
        'Employee Info'[LineofBusinessLinkKey] = SelectedEmployeeLOB
    )
VAR Quartile1 =
    PERCENTILEX.INC(
        Peers,
        [Utilization],
        0.25
    )
RETURN Quartile1

 

 

If the problem persists, please provide sample data that fully covers your issue (in the form of table or pbix file) and the expected outcome based on the sample data you provided. Please remove any sensitive data in advance.

 

 

 

 

 

Best Regards,

Jayleny

 

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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