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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kmoxley
Frequent Visitor

Z score to percentiles

I'd like to create a collum of percentiles from a collum of z-scores

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @kmoxley,

 

Suppose there is an existed column [Z-score] in source table, now you want to generate the percentile values based on z-score, right?

 

If so, please refer to below DAX formulas to create two calculated columns in source table:

Rank =
RANKX ( 'Z-Score', 'Z-Score'[Z-Score],, DESC, DENSE )

Percentile =
DIVIDE (
    CALCULATE (
        COUNT ( 'Z-Score'[Z-Score] ),
        FILTER ( 'Z-Score', 'Z-Score'[Rank] > EARLIER ( 'Z-Score'[Rank] ) )
    ),
    CALCULATE ( COUNT ( 'Z-Score'[Z-Score] ), ALL ( 'Z-Score' ) )
)

1.PNG

 

If this does not meet your requirement, please share your sample data and your desired result. Also, tell us the syntax, based on which we can calculate the percentiles.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @kmoxley,

 

Suppose there is an existed column [Z-score] in source table, now you want to generate the percentile values based on z-score, right?

 

If so, please refer to below DAX formulas to create two calculated columns in source table:

Rank =
RANKX ( 'Z-Score', 'Z-Score'[Z-Score],, DESC, DENSE )

Percentile =
DIVIDE (
    CALCULATE (
        COUNT ( 'Z-Score'[Z-Score] ),
        FILTER ( 'Z-Score', 'Z-Score'[Rank] > EARLIER ( 'Z-Score'[Rank] ) )
    ),
    CALCULATE ( COUNT ( 'Z-Score'[Z-Score] ), ALL ( 'Z-Score' ) )
)

1.PNG

 

If this does not meet your requirement, please share your sample data and your desired result. Also, tell us the syntax, based on which we can calculate the percentiles.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft@kmoxley   Thanks so much for this information.  As we work in Live Data 'In Service', the Earlier function does not work for me.  Is there a way to do this without 'Earlier'?  
Curious and many thanks !

@v-yulgu-msft Is there a way for your measures to apply to a long table? I tried it with a wide table & it worked, but not with a long one.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.