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
Morrison
Helper I
Helper I

Clusters based on the rank

Hi, in my model I have a table similar to this one below and I would like to create clusters based on the rank I reach.
I created a measure that calculates the Max rank for that sector. Now I would like to divide the sales rank by the sector maxrank and with this value which varies from 0 to 1 I want to create bands. 0 to 0.2 Hig Performer, 0.2 to 0.4 Medium Performer, 0.4 to 0.6 Low Performer, 0.6 to 0.8 Very Low Performer, 0.8 to 1" Not classifiable". The next step is to count how many times store A ranked as High Performer, how many times low performer, etc...
How can I achieve this goal?
Thank you all for the support

 

Morrison_1-1705747145989.png

 

4 REPLIES 4
Stachu
Community Champion
Community Champion

in order to present the Group Names in a visual like matrix, you need these entries to be avialable in a table, it cannot be handled only by a measure. I suggest adding following table (let's call it Clusters) to the model:

GroupNameBandStartBandEnd
HighPerformer00,2
Medium Performer0,20,4
Low Performer0,40,6
Very Low Performer0,60,8
Not Classifiable0,81

without adding any relationships. With that table you can put the Table[Store] and Clusters[GroupName] in the visual, and use measure like this:

 

 

StoreInClusterCount =
VAR _cluster =
    SELECTEDVALUE ( 'Clusters'[GroupName] )
VAR _store =
    SELECTEDVALUE ( 'Table'[Store], BLANK () )
VAR _band_start =
    MIN ( 'Clusters'[BandStart] )
VAR _band_end =
    MAX ( 'Clusters'[BandEnd] )
VAR _stores =
    FILTER (
        'Table',
        [GroupNumber] >= _band_start
            && [GroupNumber] < _band_end
    )
RETURN
    COUNTROWS ( _stores )

 

 


I would also recommend to sort column Clusters[GroupName] by one of the bands column in the table settings, this will force business order over the alphabetic one

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu  Thanx, i try but the visual is blank.

Stachu
Community Champion
Community Champion

what's the code for the [GroupNumber] measure? is the table granularity similar to what you posted in the example, are are these aggregated values by Store, Contest and Sector?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

My template table looks like this, and I created the 2 measures to calculate the rankmaximum for each sector and the groupnumber

 

Morrison_0-1706006283068.png

 

GroupNumber = var vrankstore = max(FactVenduto_Rank[RankVenduto_Comparto])

                           var vmaxrankcomparto = [RankMax]
                          return  divide(vrankstore,vmaxrankcomparto)
 
RankMax = calculate(    max(FactVenduto_Rank[RankVenduto_Comparto]),all(FactVenduto_Rank[StoreKey]),values(FactVenduto_Rank[Comparto]))
 

Yes, I confirm that the data is aggregated

 
 

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.