Forum Discussion
mohammedkhan
Helper I
7 years agoRank Selection Branches and Sub Branches
Dear All, I have made Three Meaures and Rank Table where I enter the rank column value as 3 5 10 to use the Slicer as a top 3 to Top 10 Based on the Slicer selection, but when i select 3 it is sh...
- 7 years ago
Hello mohammedkhan
You can skip the ranking and use TOPN with your ranking measure to get your TOPN games. It would look something like this.
Top N Game Income = VAR _Ranks = SELECTEDVALUE ( Ranks[Rank] ) VAR _RankingContext = VALUES ( 'Game Income'[Games] ) RETURN CALCULATE ( [Total Game Income], TOPN ( _Ranks, ALL ( 'Game Income'[Games] ), [Total Game Income] ), _RankingContext )Take a look at this video for more information on the example.
- 7 years ago
The problem you are running into is your ALL ( 'Games Income' ) is bringing the whole table, not just all the games. What you want is this.
Game Rank = IF ( NOT ISINSCOPE ( 'Game Income'[Games] ), BLANK(), RANKX ( ALL ( 'Game Income'[Games] ), [Total Game Income] ) )And if you want the rank only on the TopN games you can use this.
TopN Game Rank = IF ( ISBLANK ( [Top N Game Income] ) || NOT ISINSCOPE ( 'Game Income'[Games] ), BLANK(), RANKX ( ALL ( 'Game Income'[Games] ), [Top N Game Income] ) )
jdbuchanan71
Super User
7 years agoThe problem you are running into is your ALL ( 'Games Income' ) is bringing the whole table, not just all the games. What you want is this.
Game Rank =
IF (
NOT ISINSCOPE ( 'Game Income'[Games] ), BLANK(),
RANKX ( ALL ( 'Game Income'[Games] ), [Total Game Income] )
)
And if you want the rank only on the TopN games you can use this.
TopN Game Rank =
IF (
ISBLANK ( [Top N Game Income] ) || NOT ISINSCOPE ( 'Game Income'[Games] ), BLANK(),
RANKX ( ALL ( 'Game Income'[Games] ), [Top N Game Income] )
)mohammedkhan
Helper I
7 years agoThank you jdbuchanan71