Forum Discussion
Anonymous
5 years agoNot applicable
Adding additional criteria to RANKX
I have a column which ranks by student code and date change using the following: Rank = RANKX( FILTER( 'Table', [StudentID] = EARLIER( [StudentID] )), [ChangeDate] , , ASC, DENSE) which give...
- 5 years ago
Hi Anonymous
Rank V2 = RANKX ( FILTER ( Table1, Table1[StudentID] = EARLIER ( Table1[StudentID] ) && Table1[AcademicYear] = EARLIER ( Table1[AcademicYear] ) ), Table1[ChangeDate], , ASC, DENSE )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
edhans
5 years agoCommunity Champion
The following measure will do it Anonymous I believe.
New Rank =
VAR varStudentID =
MAX( 'Table'[StudentID] )
VAR varAcademicYear =
MAX( 'Table'[AcademicYear] )
VAR Result =
RANKX(
FILTER(
ALL( 'Table' ),
'Table'[StudentID] = varStudentID
&& 'Table'[AcademicYear] = varAcademicYear
),
CALCULATE(
SELECTEDVALUE( 'Table'[ChangeDate] )
),
,
ASC,
DENSE
)
RETURN
Result