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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.