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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Top N Visuals, Others need to mention as Others

Hi,

 

Below is the sample data, Need to create Bar chart with TOP N Condition as DAX.

 

DateWeekSalesCountry
22-08-202235400Ind
29-08-202236365Aus
05-09-202237876US
12-09-202238356UK
19-09-202239234China
26-09-202240555MEA
03-10-202241322Ind
10-10-202242373Aus
17-10-202243355US
24-10-202244338UK
31-10-202245320China
07-11-202246302MEA
14-11-202247285Ind
21-11-202248267Aus
28-11-202249249US
05-12-202250231UK

 

where X-Axis =Last 4 Week,Y-Axis = Sum of Sales,Legend = Country (Other than Top 3, other category need to mention as Others)

But the condition is 

Need to create DAX that show Top 3 Country with respect to sales and Date. All other countries need to mention as Others.

Example : 

 

 Wk-47Wk-48Wk-49Wk-50TOPN
Aus123120129543915
Ind11113212344410
UK908099100369
Others3214321236521528

 

Thank you,

@Uspace87 

@amitchandak 

@Greg_Deckler 

@lbendlin 

 

 

3 REPLIES 3
lbendlin
Super User
Super User

your example doesn't match your source data.

As @TomasAndersson pointed out: A general rule – Anything that is displayed on the x-axis of a chart needs to be physically present as a column of a table.   That also applies to matrix visuals.  You cannot use a measure to influence a column.  Here is a recipe to precompute the options:

Power BI – Dynamic TopN + Others with Drill-Down – Gerhard Brueckl on BI & Data (gbrueckl.at)

 

see attached

TomasAndersson
Solution Sage
Solution Sage

Hi!
I've used this guide to do similar things, maybe this can help you too: Display Top N items and Others in Power BI - Goodly

Anonymous
Not applicable

Hi TomasAndersson,

Thanks for replying!

This works only with Category.If i drag and drop date field its not working.

I need calculation that needs to work with Date and Category axis together.

 

Thank you,

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.