DAX - If Expiration DATE btwn 2 dates then "EXPIRING SOON"

I have a table of Professional Licenses and the date they EXPIRE
I need a SLICER that use can select “EXPIRED”, or “EXPIRING IN 90 DAYS”
See attached Image

Hi @DMercier,

Give this a go, add a new (dax) table:

Table =
    UNION (
        ROW ( "Licence status", "ACTIVE", "Expires", DATE( 2022, 12, 31 ) ),
        ROW ( "Licence status", "ACTIVE", "Expires", DATE( 2022, 12, 13 ) ),
        ROW ( "Licence status", "ACTIVE", "Expires", DATE( 2022, 12, 11 ) ),
        ROW ( "Licence status", "ACTIVE", "Expires", DATE( 2022, 11, 30 ) ),
        ROW ( "Licence status", "ACTIVE", "Expires", DATE( 2022, 9, 10 ) )
    )

.
and add a new (calculated) column to that table with this code

Expire group = 
VAR t = TODAY() RETURN
 IF( [Expires] > t && t >= [Expires]-90,
    "EXPIRES IN 90D",
    IF( [Expires] < t,
        "EXPIRED"
    )
 )
1 Like

I used the following for one of my reports to create a calculated column

IF(DATEDIFF(TODAY(),‘Table’[Expires], DAY)<0,“Expired”,
IF(DATEDIFF(TODAY(),‘Table’[Expires], DAY)<=90,“Expires in 90 days”))

1 Like

Melissa,

Thank you for taking the time to respond to me so quickly!
I’m not familiar with the UNION but was able to use the next person’s suggestion to solve my issue. You all are so awesome and greatly appreciated

Oksana,
Thank you for your quick response. I was able to add it to my table and filter as desired. You all are awesome!

1 Like