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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Elieekh17
Helper II
Helper II

help rank data

Hello Community,

 

I need to categorize a visual by the below: 

 

Black / platinum is the 5% of the entity with highest spend

Gold is top 20% to top 5%

Silver is top 50% to top 20%

Bronze is bottom 50%

 

Noting that Code and Name comes from a dimension table1 while Year and Month comes from tabl2, spend is a measure

can you help how to address this ? is there any other method than the Rank or topN 

 

Thank you

screenshot of exported data from Power BI

Elieekh17_0-1743516466579.png

 

1 ACCEPTED SOLUTION

I forgot to unfilter the table, updated in the first post


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

5 REPLIES 5
Deku
Super User
Super User

medal =
var tbl = 
CALCUATETABLE(
   SUMMARIZE(
      tabl2,
      table1[Code],
      table1[Name],
      tabl2[YEAR],
      tabl2[Month]
   ),
   ALLSELECTED()
)
var platinum = PERCENTILEX.INC(tbl, [Spend], 0.95)
var gold =     PERCENTILEX.INC(tbl, [Spend], 0.8)
var silver =   PERCENTILEX.INC(tbl, [Spend], 0.5)
var val =      [Spend]
RETURN
SWITCH(
   true,
   val >= platinum, "Platinum",
   val >= gold,     "Gold",
   val >= silver,   "Silver",
   "Bronze"
)

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thank you for your input, I put the formula that you have provided but I only got Platinum and bronze values only

I forgot to unfilter the table, updated in the first post


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thank you @Deku , it worked I adjusted the spend >0 and not is blank

VAR tbl = CALCULATETABLE(
   SUMMARIZE(
      SITE,
      SITE[SRU_CODE],
      SITE[SRU_DESCL_EN]
   ),
   ALLSELECTED()
)
VAR platinum = PERCENTILEX.INC(tbl, [Spend per Nb Purchaser 12RM], 0.95)
VAR gold =     PERCENTILEX.INC(tbl, [Spend per Nb Purchaser 12RM], 0.7)
VAR silver =   PERCENTILEX.INC(tbl, [Spend per Nb Purchaser 12RM], 0.5)
VAR val = [Spend per Nb Purchaser 12RM]

RETURN IF(NOT(ISBLANK([Spend per Nb Purchaser 12RM])),
SWITCH(
   TRUE(),
   val >= platinum, "Platinum",
   val >= gold,     "Gold",
   val >= silver,   "Silver",
   "Bronze"
)
)
I couldn't add the 2 columns from TIME table and the result is only platinum and gold 😞

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.