Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Not Started, Completed, In Progress based on Dates

Hi,   I am trying to give status to my progect activities based on Slicer Date:       Measure = VAR slicer = [SELECTED VALUE] return IF('Activities'[PlannedStart] < sl...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Anonymous ,

    The Max()/Min() functions express different meanings in calculated and measure, for example:

    1. Using the Max() function in calculated is to take the maximum value of this column, see the result below

    max_measure = MAX('Activity'[planned finish])

    [planned finish] The largest date in the column is 2024.10.9

    2. Use the max() function in measure to take the value of the current row.

    max_measure = MAX('Activity'[planned finish])

    Take out the current value of each row

    So use the following function according to your rules, you can compare the value in the slicer with each Activity in the table row by row and compare the start and finish dates of each activity

    Measure 2 =
    var _select =SELECTEDVALUE('Table'[Date])
    return
    IF(MAX('Activity'[planned start]) <_select,"Not Started", IF(_select > MAX('Activity'[planned finish]), "Completed" , "In Progress"))

    Best Regards,

    Liu Yang

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