Forum Discussion

dreyes6's avatar
dreyes6
Helper I
4 years ago
Solved

Find Latest Date

I'm trying to make an output that is looking for the latest date below is my data, there are names that have multiple image and I need the image with te latest date ID Name   IMAGE Pric...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi dreyes6 ,

     

    Please try this:

    IMAGE OUTPUT = 
    VAR _latest_date =
        CALCULATE (
            MAX ( 'Table'[Effective Date] ),
            FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) )
        )
    VAR _output =
        CALCULATE (
            MAX ( 'Table'[IMG] ),
            FILTER (
                'Table',
                'Table'[Effective Date] = _latest_date
                    && 'Table'[ID] = EARLIER ( 'Table'[ID] )
            )
        )
    RETURN
        _output

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data