Forum Discussion

CA8172's avatar
CA8172
Icon for Helper I rankHelper I
4 years ago
Solved

Getting Max Date tied to specific ID

I have a list of Tracking ID's with respective Assessment ID's.  The tracking ID is the same but a different assessment ID for each tracking ID.  We use the same create date and tracking completion date, but each assessment can be completed on a different date (see below).

Tracking IDAssessment IDDate CreateTracking CompAssessment Comp
548794110019/1/20219/30/20219/5/2021
548794110029/1/20219/30/20219/28/2021
548794110039/1/20219/30/20219/17/2021
     
451265105549/15/202110/27/20219/17/2021
451265100559/15/202110/27/202110/1/2021
451265100569/15/202110/27/202110/20/2021
451265100579/15/202110/27/20219/30/2021
451265100589/15/202110/27/20219/30/2021
451265100599/15/202110/27/202110/7/2021
     
4512651178510/7/202112/1/202111/30/2021
4512651178610/7/202112/1/202110/28/2021
4512651178710/7/202112/1/202110/29/2021
4512651178810/7/202112/1/202111/7/2021

 

I need to figure out a way to determine what the Max Assessment Date is for each Tracking ID (see below).

Tracking IDAssessment IDDate CreateTracking CompAssessment Comp
548794110029/1/20219/30/20219/28/2021
451265100569/15/202110/27/202110/20/2021
4512651178510/7/202112/1/202111/30/2021

 

I have tried the MAX formula, but since we need to use it respectively back to a tracking ID, I only get the max date of (for example) yesterday.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi CA8172 ,

     

    Create a measure and put it into the visual level filter. Set show items when the value is 1.

    Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Date Create]=MAX('Table'[Date Create])),[Assessment Comp])
    return IF(_max=MAX('Table'[Assessment Comp]),1)

    You can check more details from the attachment.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • CA8172,

     

    Use this measure as a visual filter. In your sample data, did you mean to use three different Tracking ID?

     

    Max Assessment Comp =
    VAR vMaxDate =
        CALCULATE (
            MAX ( Table1[Assessment Comp] ),
            ALLEXCEPT ( Table1, Table1[Tracking ID] )
        )
    VAR vResult =
        IF ( MAX ( Table1[Assessment Comp] ) = vMaxDate, 1 )
    RETURN
        vResult

     

     

     

  • Create calculated column to assign flag and filter it

    Flag = 
    var maxAsses = CALCULATE( MAX(Table2[Assessment ]),FILTER(Table2,EARLIER(Table2[TrackingID])=Table2[TrackingID]&&Table2[Create] = EARLIER(Table2[Create])))
    return 
    if ( maxAsses = Table2[Assessment ],"X" )

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi CA8172 ,

     

    Create a measure and put it into the visual level filter. Set show items when the value is 1.

    Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Date Create]=MAX('Table'[Date Create])),[Assessment Comp])
    return IF(_max=MAX('Table'[Assessment Comp]),1)

    You can check more details from the attachment.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.