Forum Discussion

RicFischer's avatar
RicFischer
Helper I
5 years ago
Solved

Calculated Column - RankX with Filter

Hi,   I have a table with the following that has date+time (ActivityStart), grade (Grade), and a concatenated field (StudentCourseStageUnit). I need to rank each identical StudentCourseStageUnit wh...
  • AlB's avatar
    5 years ago

    Hi RicFischer 

    AttemptNumberCol = 
    CALCULATE (
        COUNT ( AttemptNumber[ActivityStart] ),
        AttemptNumber[ActivityStart] <= EARLIER ( AttemptNumber[ActivityStart] ),
        AttemptNumber[Grade] IN { "S", "U" },
        ALLEXCEPT ( AttemptNumber, AttemptNumber[StudentCourseStageUnit] )
    )

     

    Please accept the solution 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.

     

  • AlB's avatar
    AlB
    5 years ago

    RicFischer 

    How long? Try this

    Col = 
            COUNTROWS (
                FILTER (
                    ALL (
                        AttemptNumber[ActivityStart],
                        AttemptNumber[Grade],
                        AttemptNumber[StudentCourseStageUnit]
                    ),
                    AttemptNumber[StudentCourseStageUnit]
                        = EARLIER ( AttemptNumber[StudentCourseStageUnit] )
                        && AttemptNumber[ActivityStart] <= EARLIER ( AttemptNumber[ActivityStart] )
                        && AttemptNumber[Grade] IN { "S", "U" }
                )
            )

     

    Please accept the solution 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.