Forum Discussion
Custom column index
- 5 years ago
Anonymous
Try this, with a minor change on how the ties are broken. It uses the Index column, which we didn't have at the beginning but is very useful. Seems to match the expected results on your uploaded sample:
Attempt V2 = VAR breakTies_ = RANKX ( CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Site], Table1[Operation] ), Table1[Time Stamp] = EARLIER ( Table1[Time Stamp] ), RIGHT ( Table1[Step], 3 ) = "001" ), Table1[Index] ) - 1 RETURN CALCULATE ( COUNT ( Table1[Step] ), ALLEXCEPT ( Table1, Table1[Site], Table1[Operation] ), RIGHT ( Table1[Step], 3 ) = "001", Table1[Time Stamp] <= EARLIER ( Table1[Time Stamp] ) ) - breakTies_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
Anonymous
Try this, with a minor change on how the ties are broken. It uses the Index column, which we didn't have at the beginning but is very useful. Seems to match the expected results on your uploaded sample:
Attempt V2 =
VAR breakTies_ =
RANKX (
CALCULATETABLE (
Table1,
ALLEXCEPT ( Table1, Table1[Site], Table1[Operation] ),
Table1[Time Stamp] = EARLIER ( Table1[Time Stamp] ),
RIGHT ( Table1[Step], 3 ) = "001"
),
Table1[Index]
) - 1
RETURN
CALCULATE (
COUNT ( Table1[Step] ),
ALLEXCEPT ( Table1, Table1[Site], Table1[Operation] ),
RIGHT ( Table1[Step], 3 ) = "001",
Table1[Time Stamp] <= EARLIER ( Table1[Time Stamp] )
) - breakTies_
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
- Anonymous5 years agoNot applicable
Thank yoouuu AIB this worked perfectly and it didn't take too long to run either(only couple of seconds).