cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
karma123
Advocate I
Advocate I

Rank in Card visual with filter

Hi, 

 

I have the below table

 

Company GroupPremium
Company 1     4,102,813
Company 2   132,970,639
Company 346,137,791

 

I have a rank formula on a card visual displaying the rank for Company 1. 

 

rankx(all('Table'[Company Group]),CALCULATE(sum('Table'[Premium])))

 

 

Each company is split out by subsidiaries as below, 

I filter for Company 1 and only for Company 1 uk and Company 1 europe the rank just gives me 1. 

 

How do I update the formula so I can filter for the Company Names but still get the rank for Company group? 

 

Company GroupCompany NamePremium
Company 1Company 1 UK        175,430
Company 1Company 1 Europe     3,469,536
Company 1Company 1 Canada        457,847
Company 2Company 2 UK   35,790,532
Company 2Company 2 Europe     3,457,931
Company 2Company 2 Canada     6,889,328
Company 3Company 3 UK   85,768,320
Company 3Company 3 Europe   45,963,343
Company 3Company 3 Canada     1,238,976

 

 

karma123_0-1677153050331.png

 

Thanks, 

 

 

 

 

4 REPLIES 4
karma123
Advocate I
Advocate I

 
have managed to get the formula to work but the rank is not updating when I select the Company Names.
 
Rank = RANKX( ALL( Table[Company Group]), CALCULATE(([premium]), ALLEXCEPT('Table',Table[Company Group] )))
karma123
Advocate I
Advocate I

Thanks I got the following error

karma123_0-1677244306842.png

 

The code I posted works for me. Can you post a screenshot of your measure?

johnt75
Super User
Super User

You can use

Group rank = RANKX( ALL( 'Table'[Company Group]), CALCULATE( SUM('Table'[Premium]), ALLEXCEPT('Table', 'Table'[Company Group]) ) )

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors