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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
somyasahu
Regular Visitor

Top 5 Countries for various categories

Hi,

 

I am new to PBI and I have a data for 6 different product categories of 40 countries each with different revenue numbers. [ One column each for product category, country name, revenue number and year) I want top 5 countries for each category basis the revenue figures. Using a calculated column, PBI does not consider the different product categories and just results in the total rank from the overall data. Using the calculated measure, I get an error that one single value cannot be found for this field. Please help. Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@somyasahu

 

No problem, I want to help you out. Try this out. This should work for every product category, just slice on it:

 

topn soultion.png

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @somyasahu

 

What measure did you try to use? Can you make an example of how your data is stored?

Hi,

 

For measure, I used RANKX using SUM, ALLSELECTED and tried with a couple of more functions that i found online.

 

My data is stored as below

 

Product CategoryCountryYearRevenue in mnQuarter
Category 1Bosnia20163Q1
Cat 2Australia20170Q3
Cat 2China20161Q2
Cat 3Colombia20160Q1
Anonymous
Not applicable

@somyasahu

 

And you want to base you rank on the revenue?

Yes. Thanks for the prompt responses 🙂

Anonymous
Not applicable

@somyasahu

 

No problem, I want to help you out. Try this out. This should work for every product category, just slice on it:

 

topn soultion.png

Thank you. This worked 🙂

Anonymous
Not applicable

@somyasahu

 

I'm glad it worked out for you. Don't forget to give me kudos 😉

Sure. I am new here. DId you get the kudos? 😛

Anonymous
Not applicable

I did, thank you very much 😛 I also gave you some kudos 🙂

Thank you 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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