Forum Discussion
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 ID | Start Date | End Date | RESULT |
| 60235 | 01/01/2023 | 31/12/2023 | Live |
| 60236 | 01/01/2023 | 15/10/2023 | Live |
| 60237 | 01/01/2023 | 30/06/2023 | Expired |
| 60238 | 01/01/2022 | 31/12/2022 | Expired |
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
- nabandla
Helper I
Status Measure = VAR CurrentRowStartDate = MAX('Table'[Start Date]) VAR CurrentRowEndDate = MAX('Table'[End Date]) RETURN IF ( AND(TODAY() >= CurrentRowStartDate, TODAY() <= CurrentRowEndDate), "Live", "Expired" )
- snow84Frequent 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")