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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
StuBee
Helper I
Helper I

Top Sales Person By Product

Hi Everyone

 

I am struggling to create a view of the top sales person in a grid that lists total overall sales.

 

Amongst my data is a roll up of total sales, joined to a product chart, this can be then filtered by Person.

 

I have tried the Rankx filtering the Person on the graph, to no luck.

 

The columns I need are something like:

SalesRepProductTotal Sales
JamesA10
JamesB12
PaulA25
PaulB2
PaulC16
JeffA18
JeffC29

 

I am looking to display it like:

ProductSalesTop Sales Rep
A53Paul
B14James
C45Jeff

 

Thanks for looking

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@StuBee , Create a rank like this and use visual level filter  =1

rankx(filter(allselected(Table[SalesRep],Table[Product]), Table[Product] =max(Table[Product])), calculate(sum(Table[Sales])))

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

View solution in original post

2 REPLIES 2
StuBee
Helper I
Helper I

Hi and Thanks So much @amitchandak 

If I had another table with just a list of regional office in it, that joines to each offices sales data on the office name column, is there anway that I could do the same  but by "Office" instead of "Sales Rep"?

I wanted to ask if it were possible to do the ranking from the offices, which are all listed together on a seperate Table like:

Office
1
2
3
4

 


The sales data comes from each office as above but with an office name,

SalesRepProductOfficeTotal Sales
JamesA110
JamesB112
PaulA125
PaulB12
PaulC116
JeffA118
JeffC129


pulled to power bi, summed on the product table in the same format, then listed as in the first example.

 

Could I display it like

ProductSalesTotal Office
A3201
B2502
C1803

Again thanks so much for the response

 

amitchandak
Super User
Super User

@StuBee , Create a rank like this and use visual level filter  =1

rankx(filter(allselected(Table[SalesRep],Table[Product]), Table[Product] =max(Table[Product])), calculate(sum(Table[Sales])))

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.