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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
theo
Helper III
Helper III

Rankz measure with countrows always return 1

Need help on using RankX measure that always shows as 1 in visual.

tried so many iterations provided in this forum but cannot really the right DAX.  Hope someone can help.

Measure = 
var _countif=calculate(COUNTROWS(FILTER('28Jun_1973',[Rcode]='28Jun_1973'[Rcode])))
var measure_rank = RANKX(all('28Jun_1973'),_countif,,,Dense)
return measure_rank

 

1 ACCEPTED SOLUTION

found the correct expression.  Thanks all for nudging me to the right direction.

RANKX(ALL('28Jun_1973'[RCode]),calculate(COUNTROWS(FILTER('28Jun_1973',[RCode]='28Jun_1973'[RCode]))),,,Dense)

 

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Measures : =
VAR measure_rank =
RANKX (
ALL ( '28Jun_1973' ),
CALCULATE (
COUNTROWS ( FILTER ( '28Jun_1973', [Rcode] = '28Jun_1973'[Rcode] ) )
),
,
,
DENSE
)
RETURN
measure_rank

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks @Jihwan_Kim , however, when I used the expressing in visual, the processing is too slow.  10minutes, still have not completed.

Any variation of the expression you can suggest.

thanks.

aj1973
Community Champion
Community Champion

Hi @theo 

Can you provide a Sample of your file

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi @aj1973 ,

here you go:

 

ID     RCode RankAdvance
1000AAAXYZ
1001AAAZY1
1002AABXYZ

found the correct expression.  Thanks all for nudging me to the right direction.

RANKX(ALL('28Jun_1973'[RCode]),calculate(COUNTROWS(FILTER('28Jun_1973',[RCode]='28Jun_1973'[RCode]))),,,Dense)

 

aj1973
Community Champion
Community Champion

@theo 

Sorry, what am I suppose to do with this!?

I invite you to check out this 

How to Get Your Question Answered Quickly - Microsoft Power BI Community

aj1973_0-1625969654383.png

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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