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
Anonymous
Not applicable

Dynamic TopN + specific company / Dynamic Top N and Others category and own company category

Hello Everyone!

 

I have a table 'DATA' which has the following columns: Company, Market (e.g. car, tram, bicycle), Sales, Date. 

 

By now, I used the function rankx to categorize the companys into top 10 and others. Then I built a dynamic Top10 Table to show the Top10 companys per market (which is filtered via dataslicer). My Problem is, that I always want to track a specific company (same company for every market) in every market. The company needs to be shown in the top10 table, no matter of her own rank (even if not <=10). So far I tried to do a workaround by splitting up the companys in TopN, Others and specific company but this didn´t work out.

 

Do you have any idea, on how to achieve, that the table always shows that specific company and only Top 10 (or Top 9)?

Please help!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Sorry for the late reply.

Create a measure as below:

Measure = 
var _topn=TOPN(10,ALLSELECTED('Table'),'Table'[Sales],DESC)
Return
CALCULATE(MAX('Table'[Sales]),KEEPFILTERS(_topn))

And you will see:

Annotation 2020-08-12 093612.png

The top 10 will be based on your slicers.

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you pls provide some sample data?

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

Hi Kelly,

 

I´ll attached you some sample data. As seen from the data, the specific company is mostly not part of the top10 (each day), but sometimes (market: Bicycle, date: 05.08.2020) it is part of the top10.

 

MarketCompanySalesDate
CarCompany11004.08.2020
CarCompany1304.08.2020
CarCompany1904.08.2020
CarCompany2704.08.2020
CarCompany2204.08.2020
CarCompany31504.08.2020
CarCompany41104.08.2020
CarCompany51904.08.2020
CarspecificCompany404.08.2020
CarCompany73504.08.2020
CarCompany82404.08.2020
CarCompany93704.08.2020
CarCompany101204.08.2020
CarCompany114904.08.2020
CarCompany122804.08.2020
CarCompany1905.08.2020
CarCompany1205.08.2020
CarCompany1805.08.2020
CarCompany2605.08.2020
CarCompany2105.08.2020
CarCompany31405.08.2020
CarCompany41005.08.2020
CarCompany51805.08.2020
CarspecificCompany305.08.2020
CarCompany73405.08.2020
CarCompany82305.08.2020
CarCompany93605.08.2020
CarCompany101105.08.2020
CarCompany114805.08.2020
CarCompany122705.08.2020
BicycleCompany11204.08.2020
BicycleCompany1504.08.2020
BicycleCompany11104.08.2020
BicycleCompany2904.08.2020
BicycleCompany2404.08.2020
BicycleCompany31704.08.2020
BicycleCompany41304.08.2020
BicycleCompany52104.08.2020
BicyclespecificCompany604.08.2020
BicycleCompany73704.08.2020
BicycleCompany82604.08.2020
BicycleCompany93904.08.2020
BicycleCompany101404.08.2020
BicycleCompany115104.08.2020
BicycleCompany123004.08.2020
BicycleCompany11705.08.2020
BicycleCompany11005.08.2020
BicycleCompany11605.08.2020
BicycleCompany21405.08.2020
BicycleCompany2905.08.2020
BicycleCompany32205.08.2020
BicycleCompany41805.08.2020
BicycleCompany52605.08.2020
BicyclespecificCompany4905.08.2020
BicycleCompany74205.08.2020
BicycleCompany83105.08.2020
BicycleCompany94405.08.2020
BicycleCompany101905.08.2020
BicycleCompany115605.08.2020
BicycleCompany123505.08.2020

Hi @Anonymous ,

 

Sorry for the late reply.

Create a measure as below:

Measure = 
var _topn=TOPN(10,ALLSELECTED('Table'),'Table'[Sales],DESC)
Return
CALCULATE(MAX('Table'[Sales]),KEEPFILTERS(_topn))

And you will see:

Annotation 2020-08-12 093612.png

The top 10 will be based on your slicers.

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

Thanks for your feedback! The shown instructions are well written on how to rank TopN (Top10). But I need to know on how to show a table including only topN + one more specific company. 

Do you have further ideas on how show top9 + a specific company?

 

Best Regards

Jonas 

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.