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

RankX

RankX measure in card visual is showing a different number to the rank displayed in a table visual, 

 

Is there any solution for this?

 

1 ACCEPTED SOLUTION

@karma123 

I have attached a file for you, please check. It works for me.

Fowmy_0-1702277326557.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
karma123
Helper II
Helper II

I tried the following but am getting blank appear in the visual. 

Test Rank = RANK( DENSE, ALL(Category[Category Names]), ORDERBY( [Premium], DESC ))

 

Note the premium amount is a DAX measure that has been used.

In the card visual I am adding a filter to select only one category. 

 

 

Example Data as below

 

Rank Category    Premium

1       Food          £100

2       Lifestyle     £80

3       Transport   £60

4       Education   £20

 

 

When I put transport in a card it gives the rank as 4 when it should be 3 as shown in the table. 

 

 

@karma123 

I have attached a file for you, please check. It works for me.

Fowmy_0-1702277326557.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thank you so much! This has now worked 🙂
Fowmy
Super User
Super User

@karma123 

Yes that's correct, it all depends on the context on which the calculation happens. Please provide some data and the expected results.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I am using the RANKX(ALL(Category[Category Names]), [Premium]) formula in the table and card visual. When I filter for a specific category it gives a different result in the table and card visual.

 

Do I need to use a different measure for the card visual?

@karma123 

You can use the same measure for both as follows. Change DESC  to ASC if needed.

Rank Category = 

RANK(
    DENSE,
    ALL(Category[Category Names], 
    ORDERBY( [Premium], DESC ) 
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
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.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

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.

Top Solution Authors