Forum Discussion

RDF25087's avatar
RDF25087
Icon for Helper I rankHelper I
3 years ago
Solved

If TODAY is between 2 dates

Hi all -

 

This seems pretty straight forward - but I can't find a straight forward answer.

 

I have a table of contracts with a start and end date. I simply need a measure that will state that if TODAY() is in between the start and end date it reurns "Live", else "Expired" - please see example table below:

 

Contract IDStart DateEnd DateRESULT
6023501/01/202331/12/2023Live
6023601/01/202315/10/2023Live
6023701/01/202330/06/2023Expired
6023801/01/202231/12/2022Expired

 

Help!

 

Thanks

RDF

  • Status Measure = VAR CurrentRowStartDate = MAX('Table'[Start Date]) VAR CurrentRowEndDate = MAX('Table'[End Date]) RETURN IF ( AND(TODAY() >= CurrentRowStartDate, TODAY() <= CurrentRowEndDate), "Live", "Expired" )

3 Replies

  • Status Measure = VAR CurrentRowStartDate = MAX('Table'[Start Date]) VAR CurrentRowEndDate = MAX('Table'[End Date]) RETURN IF ( AND(TODAY() >= CurrentRowStartDate, TODAY() <= CurrentRowEndDate), "Live", "Expired" )

  • snow84's avatar
    snow84
    Frequent Visitor

    Do you want a measure or a calculated column? If you just want a column, this should work:

     

    RESULT = IF(TODAY() > [Start Date] && TODAY() < [End Date], "Live", "Expired")

  • snow84- thanks for the response. Apologies, I should have been clearer - I was after a measure.