cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Top Salesperson displayed in a card

I need to display in a card, the name of the salesperson with the highest number of sales. I feel like this must be simpler than the solutions i've tried (unsuccessfully).


I want to display in a card the name of the sales person who has the highest value in another column of the same table, 'OrderQty'.

I want just the name, not the associated value. Any advice would be greatly appreciated. I feel like this is a simple generic problem, that I've been googling and trying to figure out for too long, but if needed i can provide more detail/data.


 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Top Salesperson displayed in a card

Hi @Anonymous

 

Try the following measure: 

 

 

Top Seller =
VAR temp_table =
    SUMMARIZE (
        ALL ( Sales[Salesperson] );
        Sales[Salesperson];
        "SalesTotalValue"; SUM ( Sales[SalesTotal] )
    )
RETURN
    CALCULATE (
        MAX ( Sales[Salesperson] );
        FILTER (
            ADDCOLUMNS ( temp_table; "Rank"; RANKX ( temp_table; [SalesTotalValue] ) );
            [Rank] = 1
        )
    )

Check the PBIX file attach with the result, this can need some changes depeding on your table setup.

 

Regards,

MFelix



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

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Super User
Super User

Re: Top Salesperson displayed in a card

Hi @Anonymous

 

Try the following measure: 

 

 

Top Seller =
VAR temp_table =
    SUMMARIZE (
        ALL ( Sales[Salesperson] );
        Sales[Salesperson];
        "SalesTotalValue"; SUM ( Sales[SalesTotal] )
    )
RETURN
    CALCULATE (
        MAX ( Sales[Salesperson] );
        FILTER (
            ADDCOLUMNS ( temp_table; "Rank"; RANKX ( temp_table; [SalesTotalValue] ) );
            [Rank] = 1
        )
    )

Check the PBIX file attach with the result, this can need some changes depeding on your table setup.

 

Regards,

MFelix



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

Proud to be a Datanaut!




View solution in original post

Highlighted
Anonymous
Not applicable

Re: Top Salesperson displayed in a card

Thank You! You've helped me understand how to set the arguments up for the functions used as well!

note for other users: You need to change the semicolons to commas from the code snippet and it works perfectly! Or download his attached PBIX.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 6 members 537 guests
Please welcome our newest community members: