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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
fisher_man
New Member

Ranking Help

Hi All

 

I'm new to Power BI and i am needing some help on ranking

 

My source data has a list of all the individual sales that have been made throughout the year. I want to be able to rank the sales reps based on the total YTD revenue,

 

My report has a number of slicers to select the team name, sales rep name and product sold - i would like the ranking to update depending on whatever has been selected

 

My data looks something like this:

 

Team   Sales Rep     Product     Revenue

A          Rep 1           X               $100

A          Rep 1           Y               $50

A          Rep 2           X               $100

A          Rep 2           Y               $100

B          Rep 1           X               $50

B          Rep 1           Y               $75

B          Rep 2           X               $100

 

I need to be able to see the following when a team is selected by the user: 

 

Team   Sales Rep     Revenue     Rank

A          Rep 1           $150           2   

A          Rep 2           $200           1  

B          Rep 1           $125           1   

B          Rep 2           $100           2

 

Thanks

 

1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

You can achieve your results with the below measure. Depending on what you put on the matrix the measure may change

 

=
IF (
    ISFILTERED ( Table1[SalesRep] ),
    RANKX ( ALLSELECTED ( Table1[SalesRep] ), [TotRevenue] )

)

 

where TotRevenue is a Measure = SUM( Table1[Revenue] )

 

 

2018-09-21_15-58-05.jpg

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @fisher_man,

 

It seems that the measure of LivioLanzo should solve your problem.

 

If you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LivioLanzo
Solution Sage
Solution Sage

You can achieve your results with the below measure. Depending on what you put on the matrix the measure may change

 

=
IF (
    ISFILTERED ( Table1[SalesRep] ),
    RANKX ( ALLSELECTED ( Table1[SalesRep] ), [TotRevenue] )

)

 

where TotRevenue is a Measure = SUM( Table1[Revenue] )

 

 

2018-09-21_15-58-05.jpg

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.