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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
daniel_ricardo
Frequent Visitor

ranking

I need to rank sellers based on a field that is not being filtered in the visual, just by the team that the seller belongs. It's a report made to the seller, so he must see his position among sellers on the same team. Each seller can have more than one account, that's my lowest level of glanularity.

 

I was able to solve the seller position in all teams, but not in his own team.

 

Here is the last dax i tried:

CALCULATE(
RANKX(
ALL(account[seller]),
[sales_amount]
,,, Dense
),
KEEPFILTERS(fact[store_id]),
ALLSELECTED(account[team], account[cluster])
)


5 REPLIES 5
FreemanZ
Super User
Super User

or you add a calculated column like:

RankingColumn = 
RANKX(
    FILTER(
        TableName,
        TableName[Team] = EARLIER(TableName[Team])
    ),
    TableName[Sales],
    ,ASC
)

 

it worked like:

FreemanZ_1-1680242491622.png

FreemanZ
Super User
Super User

hi @daniel_ricardo 

not sure if i fully get you. 

supposing you have table like this:

TeamSellerSales
AA11
AA22
BB11
BB22
BB33

 

try to plot a measure with columns [team] and [seller] and a measure like:

 

RankingMeasure = 
RANKX(
    FILTER(
        ALL(TableName),
        TableName[Team] = MAX(TableName[Team])
    ),
    CALCULATE(SUM(TableName[Sales])),
    ,ASC
)

 

or 

 

RankingMeasure2 = 
RANKX(
    CALCULATETABLE(
        TableName,
        ALLEXCEPT(TableName, TableName[Team])
    ),
    CALCULATE(SUM(TableName[Sales])),
    ,ASC
)

 

 

it worked like:

FreemanZ_0-1680242417518.png

 

Yes, your suggestion works in a table, but i'm using that measure in a card. In table, i think in some way we have a implicity filter behavior, because the team column is there (sorry if I'm saying something wrong). In my report I have a filter by seller, and the team is not filtered. I tested here and in this scenario it didn't work.

hi @daniel_ricardo 

try to provide some sample data?

04-03-2023 10:29 AM

Sorry, I can´t share because some data privacy, but if it helps here is the data model with relevant fields to my expression. We need to get the ranking position by des_gestor, segmento and dim_agencia.porte_agencia.

chave_ua_cart is the lowest level
des_gestor (seller) can be present in more than one chave_ua_cart
des_gestor can work in more than one segmento but must be part of one single dim_agencia.porte_agencia

 

daniel_ricardo_0-1681152818583.png

 

 

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.