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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.