Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Marking Last Date based on 2 Criteria

Good Afternoon...   I have a dataset that contains 2 key fields Machine and Sales Date and also a Date and Time Field.   I am looking to identify the LATEST END TIME where the SALES DATE and MACH...
  • v-yingjl's avatar
    v-yingjl
    5 years ago

    Hi Anonymous ,

    Based on your description, you can create a calculated column like this:

    Flag =
    VAR _latest =
        CALCULATE (
            MAX ( 'Table'[FridayEnd] ),
            FILTER (
                'Table',
                'Table'[MachineSite Join] = EARLIER ( 'Table'[MachineSite Join] )
                    && 'Table'[Friday End Capacity] = EARLIER ( 'Table'[Friday End Capacity] )
            )
        )
    RETURN
        IF ( 'Table'[FridayEnd] = _latest, "Last", "Not Last" )
    

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.