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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AnjanaTh
Frequent Visitor

How to handle Blank Rank rows in table visual in Power BI

I have a total rank measure ,which is getting derived with another measure ,for some rows I am getting blank in rank measure due to no value in another mesure .My requirement is that i want the blank rank rows to always be in below weather the user sort it in ascending or descending in the table visual in power bi . Right now when user is sorting it in ascending the blank is coming on top .is there any way to achieve it . I dont want to assign the blank ranks any value ,it should be always blank.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@AnjanaTh. I am glad to help you. 
Hello,@foodd, thanks for your concern about this issue.

And I would like to share some additional solutions below.

You can exclude null measures by nesting an if judgment outside of the sort, and then sort on the remaining non-null values.
Below is my test

this is my test data:

vjtianmsft_0-1720597365898.png

I create two measures to implement sorting based on the value of the measure.
Here is my DAX code:

M_1 = IF(SELECTEDVALUE('Table'[Score])=0,BLANK(),SELECTEDVALUE('Table'[Score]))
M_Rank_NotBlank = 
IF(
    ISBLANK([M_1]),
    BLANK(),
    RANKX(
        FILTER(
            ALL('Table'),
            'Table'[Subject] = MAX('Table'[Subject]) && NOT(ISBLANK([M_1]))
        ),
        [M_1]
    )
)

vjtianmsft_1-1720597457681.png


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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
Anonymous
Not applicable

Hi,@AnjanaTh. I am glad to help you. 
Hello,@foodd, thanks for your concern about this issue.

And I would like to share some additional solutions below.

You can exclude null measures by nesting an if judgment outside of the sort, and then sort on the remaining non-null values.
Below is my test

this is my test data:

vjtianmsft_0-1720597365898.png

I create two measures to implement sorting based on the value of the measure.
Here is my DAX code:

M_1 = IF(SELECTEDVALUE('Table'[Score])=0,BLANK(),SELECTEDVALUE('Table'[Score]))
M_Rank_NotBlank = 
IF(
    ISBLANK([M_1]),
    BLANK(),
    RANKX(
        FILTER(
            ALL('Table'),
            'Table'[Subject] = MAX('Table'[Subject]) && NOT(ISBLANK([M_1]))
        ),
        [M_1]
    )
)

vjtianmsft_1-1720597457681.png


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.