cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
miguel_tc_27
Regular Visitor

Finding the top manufacturer by total sales

Hello everyone,

I want to get the top manufacturer (the actual name) by total sales. I need a metric Top Manufacturer by Sales that I can use as a KPI in my dashboard.

I have created the metric 

Rank Manufacturer by Sales =
RANKX(ALL('Dim Product'[Manufacturer]),'Fact Sales'[Total Revenue €]) and it is working well.
But then I cannot extract the name corresponding to the rank 1 manufacturer in this metric. 
Can someone help?
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1685416983769.pngJihwan_Kim_1-1685417253685.png

Rank manufacturer by sales: = 
RANK (
    SKIP,
    ALL ( 'Dim Product'[Manufacturer] ),
    ORDERBY ( CALCULATE ( SUM ( 'Fact Sales'[Revenue] ) ), DESC )
)

 

Rank 1 manufacturer: =
CONCATENATEX (
    FILTER (
        ALL ( 'Dim Product'[Manufacturer] ),
        [Rank manufacturer by sales:] = 1
    ),
    'Dim Product'[Manufacturer],
    ", "
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1685416983769.pngJihwan_Kim_1-1685417253685.png

Rank manufacturer by sales: = 
RANK (
    SKIP,
    ALL ( 'Dim Product'[Manufacturer] ),
    ORDERBY ( CALCULATE ( SUM ( 'Fact Sales'[Revenue] ) ), DESC )
)

 

Rank 1 manufacturer: =
CONCATENATEX (
    FILTER (
        ALL ( 'Dim Product'[Manufacturer] ),
        [Rank manufacturer by sales:] = 1
    ),
    'Dim Product'[Manufacturer],
    ", "
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors