Forum Discussion

RPAI2812's avatar
RPAI2812
Helper I
4 years ago
Solved

Card based on another column

I have a column of names and a column of next exam date.

I wanted to display a card with the name of the person with the closest date to the next exam related to today().

 

How can I do this? I guess this should be simple, but I'm doing something so complex that I wanted to hear suggestions 🙂

  • Hi RPAI2812 ,

     

    One can try the following formula.

    Min_date = DATEDIFF(TODAY(),'Table'[Next exam date],DAY)
    Next_name =
    VAR rank_ =
        RANKX ( 'Table', 'Table'[Min_date],, ASC )
    RETURN
        IF ( rank_ = 1, 'Table'[Name], BLANK () )


    If the problem is still not resolved, please point it out. Looking forward to your reply.


    Best Regards,
    Henry


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

2 Replies

  • ddpl's avatar
    ddpl
    Solution Sage

    Hi,

    Try this Measure

     

    Measure 3 = LOOKUPVALUE(Card[Name],Card[Date],MIN(Card[Date]))
     

     

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi RPAI2812 ,

     

    One can try the following formula.

    Min_date = DATEDIFF(TODAY(),'Table'[Next exam date],DAY)
    Next_name =
    VAR rank_ =
        RANKX ( 'Table', 'Table'[Min_date],, ASC )
    RETURN
        IF ( rank_ = 1, 'Table'[Name], BLANK () )


    If the problem is still not resolved, please point it out. Looking forward to your reply.


    Best Regards,
    Henry


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