Forum Discussion
scabral
Helper IV
3 years agoRANK within group when filtering
Hi, I have the following data table in Power BI with a sequence by acct with highes value to lowest value: Acct LocationKey Value Type Seq 1 AAB 300 PH 1 1 AAC 550 HE 2 ...
- 3 years ago
Hi scabral
Please refer to attached file with the solutionRank = IF ( HASONEVALUE ( 'Table'[LocationKey] ), RANKX ( CALCULATETABLE ( VALUES ( 'Table'[LocationKey] ), ALLEXCEPT ( 'Table', 'Table'[Acct], 'Table'[Type] ) ), CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[LocationKey] ) ),, ASC, Dense ) )
tamerj1
Community Champion
3 years agoHi scabral
Please refer to attached file with the solution
Rank =
IF (
HASONEVALUE ( 'Table'[LocationKey] ),
RANKX (
CALCULATETABLE (
VALUES ( 'Table'[LocationKey] ),
ALLEXCEPT ( 'Table', 'Table'[Acct], 'Table'[Type] )
),
CALCULATE (
SUM ( 'Table'[Value] ),
ALLEXCEPT ( 'Table', 'Table'[LocationKey] )
),,
ASC,
Dense
)
)