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.
I have a fact table ('Reg Ranking for Top Each Year') which contains car sales in each year looks like
Brand | Year | Value
Audi | 2019 | 13777
BMW | 2019 | 20699
and additional linked table with calendar.
What i want to achieve is to show TOP selling Brands for selected Years and grouped rest as Other.
I created a Measure ->
!_registrations = sum('Reg Ranking for Top Each Year'[Value])
then another one for ranking ->
!_Brand Rank = RANKX(ALLSELECTED('Reg Ranking for Top Each Year'[Brand]), CALCULATE([!_registrations], ALLEXCEPT('Reg Ranking for Top Each Year', 'Reg Ranking for Top Each Year'[Brand]), 'Reg Ranking for Top Each Year'[Year] IN VALUES('Calendar'[Year] )),,DESC,Skip)
!_Brand Group = IF([!_Brand Rank] <= 10, 'Reg Ranking for Top Each Year'[Brand], "OTHER")
Renault should not appear because in selected years sold 21323 cars and Ford sold 22096 and should stay on the list (at 10th place in my case)
TOP10 for 2023 | TOP10 for 2022 | TOP10 for 2022-2023 (is now) | Should be
Audi | Audi | Audi | Audi
BMW | BMW | BMW | BMW
Dacia | Dacia | Dacia | Dacia
| Ford | Ford | Ford
Hyundai | Hyundai | Hyundai | Hyundai
KIA | KIA | KIA | KIA
Mercedes | Mercedes | Mercedes | Mercedes
Renault | | Renault |
Skoda | Skoda | Skoda | Skoda
Toyota | Toyota | Toyota | Toyota
VW | VW | VW | VW
I suspect that my error is in "IN VALUES" statements, but I'm not sure - could somebody help me 🙂
Thanks
Maciej
@mbylicki , check if this solution can help when you add year also to visual
Power BI- TOPN with Others- https://youtu.be/I_TY4hVlzAE
https://medium.com/microsoft-power-bi/power-bi-topn-others-8b094203a306
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 |
---|---|
13 | |
12 | |
10 | |
7 | |
7 |
User | Count |
---|---|
18 | |
14 | |
11 | |
11 | |
10 |