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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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