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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
dombarg
Helper II
Helper II

how to override Expersion Default of RANKX

hello.

as u know,The Default behavior of RANKX expersion in dealing with blank rows is to count them as zero.

how can i override this behavior in a way it counts it as blank ( or      ignore it). the problem arises in folloing picture,

please have a look rank.JPG

i've wrote this DAX:

rank max = 

RANKX (
    ALLSELECTED('1-Grouping'[کد شرکت])
    ,
    [Selected Measure],
    ,
    0,
    Dense
)

 

 

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@dombarg,

Please check if one of the following DAX returns your expected result.

rank max = 

IF( NOT ( ISBLANK ( [Selected Measure]) ) ,

RANKX (
    ALLSELECTED('1-Grouping'[کد شرکت])
    ,
    [Selected Measure],
    ,
    0,
    Dense
),

BLANK())
rank max = 

IF(  [Selected Measure]<>0 ,

RANKX (
    ALLSELECTED('1-Grouping'[کد شرکت])
    ,
    [Selected Measure],
    ,
    0,
    Dense
),

BLANK())



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yuezhe-msft
Employee
Employee

@dombarg,

I am not very clear about your requirement. Could you please share sample data of your original table and post expected result here? Also we need to know the DAX of selected Measure.

Regards,
Lydia

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

assume selected measures as SUM.

Look at the highlighted numbers and their relevant RANK.

The BI deal with zero as value and attribute a rank to them.how can i tell to "BI that ignore zero please!"

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.