Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Irbaz
Frequent Visitor

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

Table 2 = Filter(
'Table',
DateDiff(
NOW(),
'Table'[Latest Date],
Day
) <=90
)

 

** How can I add a new column with values (overdue, due) on the basis of date.

 

Document TypeLatest Date
Certificate 13/1/2022
Certificate 21/31/2024
Layout Design7/1/2022
Statement 17/1/2022
Statement 23/1/2022
Processes Description10/1/2024
Flow Diagram10/1/2024
Floor Plan7/1/2022
Schedule 11/31/2024
Schedule 27/1/2022
List 17/1/2022
List 27/1/2022
Schedule A3/1/2022
Schedule Y3/1/2022
Schedule G3/1/2022
1 ACCEPTED SOLUTION
Anonymous
Not 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.

RicoZhou_0-1652668796208.png

 

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.

 

 

View solution in original post

3 REPLIES 3
Irbaz
Frequent Visitor

@amitchandak Thank you for your reply, 

How can I create 2 columns ("overdue" and "due in 90 days") with values TRUE and FALSE, 

Anonymous
Not 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.

RicoZhou_0-1652668796208.png

 

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.

 

 

amitchandak
Super User
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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.