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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculating Dynamic Percentiles (Percent Rank and not nth Percentile)

I'm currently using New Calculated Columns to calculate Percentiles (Rankings and not a specific percentile nth) for the each row. However, I'm struggling to turn this into dynamic, where I want at each time I use a filter (slicer) to re-run the percent ranking on the filtered query.

 

This is the situation, the database contain campaigns (each row is a campaign) done each year for the past 5 years.

 

1- I calcaulted a new calculated column with formula to provide rankings:

Metric Rank = RANKX('Table','Table'[Metric])

 

2- Then another new calculated column with formula to provide percentiles based on each rank:

Metric Percent Rank = (COUNTA('Table'[Metric])-'Table'[Metric Rank])/(COUNTA('Table'[Metric])-1)

 

3- Then another new calcaluated column with formule to provide grouping of the percntile (top 33%, mid 33%..etc.) So I can tell which campaign lies in the top 33% performing campaigns based on this metric:

Metric% PercentGrouping = SWITCH(TRUE(),AND('Table'[Metric PercentRank]>0,'Table'[Metric PercentRank] <=0.33),"0-33%",AND('Table'[Metric PercentRank]>0.33,'Table'[Metric PercentRank]<=0.66),"34-66%",('Table'[Metric PercentRank]>0.67),"67-100%")

 

The final result is a visual table putting Campaign name, metric, and all calculated columns. However, the calculated columns are bsaed on the five years database, while I'd like to see rankings on different filtering options (e.g. Year, Campaign type...etc.).

 

Appreciate your help. Thank you

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Could you please kindly provide your dummy pbix that we can check it further? You can upload it to the Onedrive for business and share the link here. and don't forget disclosing the expected results into it.

 

 

Community Support Team _ Dina Ye
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.

Top Solution Authors