Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
81 | |
48 | |
37 | |
27 |
User | Count |
---|---|
185 | |
73 | |
73 | |
50 | |
42 |