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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Kyle_Buffin
Frequent Visitor

How to Create Quintiles

Hello,

 

I have sales data for products that I would like to categorize into quintiles to represent relative sales performance. Here is an example of my data:

Product

Sales $

A

$127
B$501
C$690
D$1835
E$399
F$32
G$479

 

My actual data spans for hundreds of thousands of products, and sales dollars in excess of $1M. I would like to create quintiles to break down products by performance. I would like to have the top products that compose 20% of our total sales as "A" rank, the next 20% of sales $ and their products as "B" rank, and so on down to "E" rank. To clarify, I don't want 20% of products in each quartile, I want 20% of sales $ in each quartile, and the rank will be assigned to the products based on their contribution towards total sales dollars. Is this possible within PowerBI?

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Kyle_Buffin ,

Thanks for @JamesFR06 answer. Based on your reply, I have some ideas that I want to share.

Below is my table:

vxiandatmsft_0-1710396863163.png

The following DAX might work for you:

 

 

 

Measure = SUM('Table'[Sales])

Sales Rank = RANKX(ALL('Table'[Product]), [Measure], , DESC, Dense)

Quintile = 
VAR _Rank = [Sales Rank]
RETURN
CEILING((_Rank / 7) * 5, 1)

Rank Label = 
SWITCH([Quintile],
   1, "A",
   2, "B",
   3, "C",
   4, "D",
   5, "E",
   "F" // Default or error case
)

 

 

 

The final output is shown in the following figure:

vxiandatmsft_1-1710396920860.png

Best Regards,

Xianda Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Kyle_Buffin ,

Thanks for @JamesFR06 answer. Based on your reply, I have some ideas that I want to share.

Below is my table:

vxiandatmsft_0-1710396863163.png

The following DAX might work for you:

 

 

 

Measure = SUM('Table'[Sales])

Sales Rank = RANKX(ALL('Table'[Product]), [Measure], , DESC, Dense)

Quintile = 
VAR _Rank = [Sales Rank]
RETURN
CEILING((_Rank / 7) * 5, 1)

Rank Label = 
SWITCH([Quintile],
   1, "A",
   2, "B",
   3, "C",
   4, "D",
   5, "E",
   "F" // Default or error case
)

 

 

 

The final output is shown in the following figure:

vxiandatmsft_1-1710396920860.png

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

JamesFR06
Resolver IV
Resolver IV

 to foloow the subject. I've tried and do not succeed

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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