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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rjafri2015
New Member

Excluding Top N% of values from calculated column

Hi,

I am looking for a way to exclude the top 10% and bottom top 10% of values by category for a calculated column. 

rjafri2015_0-1643911101655.png

Here is some sample data.

The "Regional CY MTD" and "Regional LY MTD" columns are the sum of CY MTD and LY MTD for all customers in those respective regions. Here is the code for the calcuation. 

Regional CY MTD = CALCULATE(SUM('Table '[Revenue]), DATESMTD('Table - Calendar'[Date]), ALLEXCEPT('Table ','Table'[Sales Region Name]))

What I would like to do is to exclude the top 10% and bottom 10% of accounts based on the "YoY MTD Diff" column when calculating Regional CY MTD and Regional LY MTD. 
1 REPLY 1
TheoC
Super User
Super User

Hi @rjafri2015 

 

I believe you should be able to achieve what you want using RANKX along with some other measures.  Here is a great article that describes the steps in achieving hoepfully what you are after: https://www.burningsuit.co.uk/find-top-or-bottom-n-percent-dax/

 

Hope this helps!

 

Theo 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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