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
dombarg
Helper II
Helper II

how to rank between two scalar

hello.how can i rank a measure only between one to four in only one DAX?

 

In other word,i need to rank only top 4 measure.for this purpose,first i've created a dax:

 

rankx =
CALCULATE (
    RANKX (
        ALLSELECTED ( '1-Grouping'[city ] ),
        [Selected Measure - TOP],
        ,
        1,
        DENSE
    ),
    '3-BS'[new year] = "2017"
)

and then following Dax to return only top rankx:

 

top rank = 

if(
[rankx] <4 , [rankx] , blank()
)

but i want to summarize them into one DAX and hence from the beginning rank only one to four of them.

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@dombarg,

 

You may learn to use Variables in DAX.

https://community.powerbi.com/t5/Desktop/DAX-Grouping-tagging/m-p/189391#M83354

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@dombarg,

 

You may learn to use Variables in DAX.

https://community.powerbi.com/t5/Desktop/DAX-Grouping-tagging/m-p/189391#M83354

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors
Top Kudoed Authors