Forum Discussion

LYeo87's avatar
LYeo87
Icon for Helper II rankHelper II
5 years ago
Solved

DAX Queries - Next 3 Months

I have a query that I'm trying to resolve.

 

1) What do I need to do to correct this expression? 

Insurance Expiring Next 3 Months? = IF([Insurance Expiry Date]<(DATEADD(TODAY,+3,MONTH),"Yes","No"))


  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi LYeo87 

    Now you want to build a calculated column to return 'Yes' if Insurance Expiry Date < Today +3Month, others return 'No'.

    DATEADD() function will return to a table instead of a value, so you can't use today function in it.

    You can try my calculated column with Date function as below.

    Insurance Expiring Next 3 Months? = IF([Insurance Expiry Date]< DATE(YEAR(TODAY()),MONTH(TODAY())+3,DAY(TODAY())),"Yes","No")

    My Sample:

     

    Best Regards,

    Rico Zhou

     

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

2 Replies