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

Summaries highest selling item per country

Hi Guys,

 

I have a dataset im trying to train on optrained  from here. I am trying to create a summary table outlining the highest selling item for each country i.e. 

 

Afghanistan --> 10 Household orders

Albania        --> 8 Persoanl Care orders

Algeria         --> 6 Baby Food, Cereal, Vegetables orders (Display all 3 categories as there is a tie) 

 

Any advice on how it can be done would be greatly appreciated. I'm primarily not looking for the solution but rather some pointers on how this can be achived. 

 

Thanks in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Summaries highest selling item per country

Hi,

I have presented multiple solutions to this problem - Determine the top selling location for each product.  Just fous on the last tab there (PowerPivot solution).  With this modified DAX formula, you will get the desired result (as you can see in the screenshot)

=CONCATENATEX ( TOPN ( 1, VALUES ( Data[Location]), [Highest revenue] ), Data[Location],", " )

This can also be solved using the Query Editor, if you so wish.

Untitled.pngOriginal dataUntitled1.pngResult in PowerPivot

ChandeepChhabra Established Member
Established Member

Re: Summaries highest selling item per country

Hi @WaqarArshad 
Have written 3 measures to solve your problem. Please download the Power BI file here

 

Capture.PNG

5 REPLIES 5
Super User
Super User

Re: Summaries highest selling item per country

Do you have a preference in completing this Power Query or do you want to strictly use DAX?

Super User
Super User

Re: Summaries highest selling item per country

Hi,

I have presented multiple solutions to this problem - Determine the top selling location for each product.  Just fous on the last tab there (PowerPivot solution).  With this modified DAX formula, you will get the desired result (as you can see in the screenshot)

=CONCATENATEX ( TOPN ( 1, VALUES ( Data[Location]), [Highest revenue] ), Data[Location],", " )

This can also be solved using the Query Editor, if you so wish.

Untitled.pngOriginal dataUntitled1.pngResult in PowerPivot

ChandeepChhabra Established Member
Established Member

Re: Summaries highest selling item per country

Hi @WaqarArshad 
Have written 3 measures to solve your problem. Please download the Power BI file here

 

Capture.PNG

WaqarArshad Regular Visitor
Regular Visitor

Re: Summaries highest selling item per country

Thank you all for reply!

@ChandeepChhabraI have just looked at your solution and it seems to be doing exactly what I was looking for.

 

I am however unsure about how/why its working. 

Could you possibly explain what the formula is doing?

 

Thanks

ChandeepChhabra Established Member
Established Member

Re: Summaries highest selling item per country

@WaqarArshad Please go through this blog post 

https://www.goodly.co.in/top-selling-product-analysis-in-powerpivot/

 

Hope this helps

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

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

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 303 members 2,843 guests
Please welcome our newest community members: