Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
i am trying to rank the values from a columns which has different categories but want to rank only specific category values. i tried below but it gives rank to all column values , how can i add the condition to get only values depending upon global or local brand -
Top10 Brands = CALCULATE(Data[Metric %],FILTER(VALUES(Data[Brand]),RANKX(ALL(Data[Brand]),[Metric %],,DESC)<=10))
my data is like below - column Brand : A,B,C,D,E,F and so on column Global/Local brand : Global,local,local,global,global and so on which means A is global brand, B is local brand,C is local brand and i want to rank only global brands
Hi @Anonymous ,
You could try the following measure:
Top10 Brands =
VAR a =
IF (
SELECTEDVALUE ( Date[Global/Local] ) = "Global",
RANKX (
FILTER ( ALLSELECTED ( Data ), Date[Global/Local] = "Global" ),
[Metric %],
,
DESC
)
)
RETURN
CALCULATE ( [Metric %], FILTER ( VALUES ( Data[Brand] ), a <= 10 ) )
If it doesn't work, you could show some sample files without any confidential information.
it is displaying the ranking but not filtering the 10 brands but showing all brands, is it due to all selected ?
attaching snapshot
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 15 | |
| 14 | |
| 12 | |
| 9 |