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 September 15. Request your voucher.

Reply
jfern78
Frequent Visitor

Rankx count occurrance

Hello community, I need to create a measure for a card that shows me the number of the 'Aging' column that is repeated the most, filtering another column called 'Active/Inactive' = "Inactive Portfolio"

I tried this.

 

RankCard =
var CountInactivePortfolio=  CALCULATE(COUNTA('Cartera Total'[system_no]),FILTER('Cartera Total','Cartera Total'[Active/Inactive']="Inactive Portfolio"))

return RANKX
(ALLSELECTED('Cartera Total'[AGING Meses]),CountInactivePortfolio,CountInactivePortfolio,DESC,Dense)

But in the card it only shows me values 1 and 18.
And not the value that is repeated the most in the ranking.

jfern78_1-1691681080658.png

 


 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @jfern78 

 

You can try the following methods.

Measure =
CALCULATE ( MAX ( 'Table'[AGING Meses] ),
    FILTER ( ALL ( 'Table' ),
        [Count] = CALCULATE ( MAX ( 'Table'[Count] ), ALL ( 'Table' ) )
    )
)

vzhangti_0-1691996187079.png

Please refer to the attachment.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @jfern78 

 

You can try the following methods.

Measure =
CALCULATE ( MAX ( 'Table'[AGING Meses] ),
    FILTER ( ALL ( 'Table' ),
        [Count] = CALCULATE ( MAX ( 'Table'[Count] ), ALL ( 'Table' ) )
    )
)

vzhangti_0-1691996187079.png

Please refer to the attachment.

 

Best Regards,

Community Support Team _Charlotte

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

 

any suggest?

It doesn't work for me, what could be wrong?

Measure: 

Rankx = var prueba =
CALCULATE ( MAX ( 'Cartera Total'[SORT MES] ),
    FILTER ( ALL ( 'Cartera Total' ), CALCULATE(COUNTA('Cartera Total'[system_no]), 'Cartera Total'[SegmentacionMapa]="Cartera Activa C/ Mora")))

Return prueba
 
jfern78_0-1693510062741.png

It returns the value 12 and it should return the value 2.

I use a calculate/counta.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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