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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Help - RANKX problem

Hi guys,

 

I have to rank customer name by Total Revenue,  with the following condition:

If revenue is blank or 0, I rank it as 0 so that it wont mess up the ranks

 

Now, going to the problem, 

If column A is in the table, I get 1s. If I add column B, I get multiple 1s again. But when I concatenate A and B and call it C, it gives the correct rankings when I display column C only. But what I want to display is A and B separately, in a table with correct rankings. 

 

By the way, column B can have multiple A. For example Cust Name = Test can have multiple Customer Number. 

 

This is the formula I used
 
Ranking = if([ Revenue] = 0 || isblank([Revenue]), 0, RANKX(ALLSELECTED(C) ,[ Revenue]))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I created a table using your data.

vcgaomsft_0-1645152936520.png

Create a new column.

 

Ranking =
IF (
    [Revenue] = 0
        || ISBLANK ( [Revenue] ),
    BLANK (),
    RANKX ( ALLSELECTED ( 'Table'[Revenue] ), [Revenue] )
)

 

Put column A, column B and Ranking column into table visual. The result should be like this.

vcgaomsft_1-1645153274416.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

I created a table using your data.

vcgaomsft_0-1645152936520.png

Create a new column.

 

Ranking =
IF (
    [Revenue] = 0
        || ISBLANK ( [Revenue] ),
    BLANK (),
    RANKX ( ALLSELECTED ( 'Table'[Revenue] ), [Revenue] )
)

 

Put column A, column B and Ranking column into table visual. The result should be like this.

vcgaomsft_1-1645153274416.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

@Anonymous , Try if this one can work

Ranking = if([ Revenue] = 0 || isblank([Revenue]), blank(), RANKX(ALLSELECTED(Customer[Cutomer]) ,[Revenue]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi,

 

It didnt work. What I got is:

 

jdalfonso_1-1644973086651.png

 

 

When I retain only column C (concatenate of A and B), I get the correct ranking:

jdalfonso_2-1644973101121.png

 

What I want to display in the table is column A and B and drop column C but with correct ranking

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.