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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

how to get calculated table or measure to get values of specific rows in column

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

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

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.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hi @v-eachen-msft 

it is displaying the ranking but not filtering the 10 brands but showing all brands, is it due to all selected ?

attaching snapshot

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.