The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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.
@Anonymous , Try to implement this in Rank - https://www.youtube.com/watch?v=vlnx7QUVYME
Top 80/20 , percent /percentile
https://blog.enterprisedna.co/implementing-80-20-logic-in-your-power-bi-analysis/
https://forum.enterprisedna.co/t/testing-the-pareto-principle-80-20-rule-in-power-bi-w-dax/459
https://finance-bi.com/power-bi-pareto-analysis/
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculate-the-sum-of-the-top-80/td-p/763156
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415