Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
Below is the sample data, Need to create Bar chart with TOP N Condition as DAX.
Date | Week | Sales | Country |
22-08-2022 | 35 | 400 | Ind |
29-08-2022 | 36 | 365 | Aus |
05-09-2022 | 37 | 876 | US |
12-09-2022 | 38 | 356 | UK |
19-09-2022 | 39 | 234 | China |
26-09-2022 | 40 | 555 | MEA |
03-10-2022 | 41 | 322 | Ind |
10-10-2022 | 42 | 373 | Aus |
17-10-2022 | 43 | 355 | US |
24-10-2022 | 44 | 338 | UK |
31-10-2022 | 45 | 320 | China |
07-11-2022 | 46 | 302 | MEA |
14-11-2022 | 47 | 285 | Ind |
21-11-2022 | 48 | 267 | Aus |
28-11-2022 | 49 | 249 | US |
05-12-2022 | 50 | 231 | UK |
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-47 | Wk-48 | Wk-49 | Wk-50 | TOPN | |
Aus | 123 | 120 | 129 | 543 | 915 |
Ind | 111 | 132 | 123 | 44 | 410 |
UK | 90 | 80 | 99 | 100 | 369 |
Others | 321 | 432 | 123 | 652 | 1528 |
Thank you,
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
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
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,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |