Forum Discussion
Anonymous
6 years agoNot applicable
Create a Rank
Hi, I'm trying to create a ranking of the accounts count of this table. That table is a duplicate of another table that has the real data. I created that table using the command "g...
- Anonymous6 years ago
Hi Anonymous ,
You can use this measure
Rank Account Name = RANKX( ALL(Table3[Account Name]), CALCULATE(SUM(Table3[Count])),,DESC,Dense)Regards,
Harsh NathaniAppreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
AntrikshSharma
6 years agoCommunity Champion
Anonymous You are getting 1 because CALCULATE inititates Context Transition and adds the currently iterated Account Name to the filter context and the formula becomes,
=
CALCULATE (
COUNTROWS ( 'Tabla Account Count' ),
'Tabla Account Count'[Account Name] = "Something", -- Coming from context transition
ALLEXCEPT ( 'Tabla Account Count', 'Tabla Account Count'[Count] )
)
Since ALLEXCEPT being a CALCULATE modifier is evaluated after context transition the COUNTROWS that you get are for whole table and can only be filtered by the Count column.
Try this code instead:
Rank =
RANKX (
ALL ( 'Tabla Account Count'[Account Name] ),
CALCULATE ( COUNTROWS ( 'Tabla Account Count' ) ),
,
DESC,
DENSE
)
Anonymous
6 years agoNot applicable
Hi. Thanks! But I received the same number 1 for all accounts in the ranking 😞
- AntrikshSharma6 years agoCommunity ChampionCan you share the pbix file or the diagram view of your model?