Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Latest date for group with dynamic date filter

Hello all   Hopefully this is the correct forum, but please correct me if I'm wrong.   I'm trying to filter the contents of a visual to show only the 'latest' record within a group, relative to a...
  • Tak94's avatar
    6 years ago

    Hi Anonymous ,

     

    You can try something like this:

     

    Latest = 
    VAR maxdate = MAX(Assessment[Date])
    VAR project = SELECTEDVALUE(Assessment[Projectid])
    RETURN CALCULATE(SELECTEDVALUE(Assessment[Stageid]),Assessment[Projectid]=project,
                                        FILTER(Projects,Assessment[Date]=maxdate))

     

     

    This will return the latest stage for a given date filter over each project_id. I added a new dummy project Beta to illustrate this below: