Forum Discussion
Today() and Now() is not working for a DAX function
I have a table and I want to filter out the records which are due in 90 days, I used the following DAX query but now() and today() function is not working, I have tried both
** How can I add a new column with values (overdue, due) on the basis of date.
| Document Type | Latest Date |
| Certificate 1 | 3/1/2022 |
| Certificate 2 | 1/31/2024 |
| Layout Design | 7/1/2022 |
| Statement 1 | 7/1/2022 |
| Statement 2 | 3/1/2022 |
| Processes Description | 10/1/2024 |
| Flow Diagram | 10/1/2024 |
| Floor Plan | 7/1/2022 |
| Schedule 1 | 1/31/2024 |
| Schedule 2 | 7/1/2022 |
| List 1 | 7/1/2022 |
| List 2 | 7/1/2022 |
| Schedule A | 3/1/2022 |
| Schedule Y | 3/1/2022 |
| Schedule G | 3/1/2022 |
- Anonymous4 years ago
Hi Irbaz ,
Try codes as below to create calculated columns.
Overdue = VAR _DATEDIFF = DATEDIFF ( TODAY (), 'Table'[Latest Date], DAY ) RETURN IF ( _DATEDIFF < 0, TRUE (), FALSE () )Due in 90 days = VAR _DATEDIFF = DATEDIFF ( TODAY (), 'Table'[Latest Date], DAY ) RETURN IF ( _DATEDIFF >= 0 && _DATEDIFF <= 90, TRUE (), FALSE () )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandak
Super User
Irbaz , try like
Table 2 = Filter(
'Table','Table'[Latest Date] >=Today() -90 && 'Table'[Latest Date] <=today())Now has time also, today is only date
- IrbazFrequent Visitor
amitchandak Thank you for your reply,
How can I create 2 columns ("overdue" and "due in 90 days") with values TRUE and FALSE,
- AnonymousNot applicable
Hi Irbaz ,
Try codes as below to create calculated columns.
Overdue = VAR _DATEDIFF = DATEDIFF ( TODAY (), 'Table'[Latest Date], DAY ) RETURN IF ( _DATEDIFF < 0, TRUE (), FALSE () )Due in 90 days = VAR _DATEDIFF = DATEDIFF ( TODAY (), 'Table'[Latest Date], DAY ) RETURN IF ( _DATEDIFF >= 0 && _DATEDIFF <= 90, TRUE (), FALSE () )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.