Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

If date is today return text string from custom column

Newbie here with simple newbie question(s).

Have table with custom column...

Want to display, in a Card visual, the string in [Today's Objective] column that corresponds with today's date, if today's date = one of the date's listed in the [Date] column. Trying IF, LOOKUPVALUE, etc but stuck. Is this a job for FILTER? This definitely doesn't work... 

Today's Class = 
IF(TODAY()<MIN('Member25'[Date]),"This course begins on...",
IF(TODAY()>MAX('Member25'[Date]),"This course has ended.",
LOOKUPVALUE('Member25'[Date],'Member25'[Today's Objective],[Today's Objective])
)
)

 Also wondering:

  1. Do I need the custom column?
  2. How to add MIN('Member25'[Date]) to the end of the first return string.

Thanks in advance!

  • Hi Anonymous 

    here is an example for concatenating strings which falls in a specific date:

    The title of the card uses conditional formatting. Create a measure which holds the titel string.

     

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)

     

     

     

2 Replies

  • FrankAT's avatar
    FrankAT
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    here is an example for concatenating strings which falls in a specific date:

    The title of the card uses conditional formatting. Create a measure which holds the titel string.

     

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Excellent! Thx FrankAT 
      This is what I did with the example...

      Today's Theme = 
      IF(TODAY()<MIN('Member25'[Date]),
      VAR _FirstDay = FILTER('Member25', 'Member25'[Date] = MIN('Member25'[Date]))
      RETURN
      CONCATENATEX(_FirstDay, "Upcoming: " & 'Member25'[Title]),
      IF(TODAY()>MAX('Member25'[Date]),"This course has ended.",
      VAR _Today = FILTER('Member25', 'Member25'[Date] = TODAY())
      RETURN
           CONCATENATEX(_Today,'Member25'[ClassTitle],", ")
      )
      )