Forum Discussion

dpcmpbll's avatar
dpcmpbll
Frequent Visitor
2 years ago
Solved

Status change based on a date from a different table

Hi everyone.  I have the first 3 columns of this table:

and I want to add the 4th column based on this table:

Using a Measure would also work for me, if that is a better way to do it.

 

Any help would be very appreciated!

4 Replies

    • dpcmpbll's avatar
      dpcmpbll
      Frequent Visitor

      Thanks ryan_mayu!  This worked great and I appreciate the quick response.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dpcmpbll ,

     

    Your solution is great, ryan_mayu . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.

     

    Create a measure:

    _upgraded = 
    VAR CurrentDate = MAX('Unit'[Date])
    VAR CurrentUnit = SELECTEDVALUE('Unit'[Unit])
    VAR UpgradeDate = LOOKUPVALUE('Update'[Upgrade Date], 'Update'[Unit], CurrentUnit)
    RETURN
    IF(
        AND(
            NOT(ISBLANK(UpgradeDate)),
            CurrentDate >= UpgradeDate
        ),
        "Y",
        BLANK()
    )

     

    Or create a calculated column:

    Upgraded = 
    VAR UpgradeDate = RELATED('Update'[Upgrade Date])
    RETURN
    IF(
        AND(
            NOT(ISBLANK(UpgradeDate)),
            'Unit'[Date] >= UpgradeDate
        ),
        "Y",
        BLANK()
    )

     

    They all work very well.

     

    pbix file is attached.

     

    If you have any further questions please feel free to contact me.

     

    Best Regards,
    Yang
    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!