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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mark_carlisle
Advocate IV
Advocate IV

Compare Date Time to NOW()

I am building a PowerBI report based off data in a SharePoint list.

 

I am looking to have a new column within the data to work out if the item is within SLA or not and gives the output Yes, No or Investigation.

 

There is a requirement to check if the list item is completed or not and use the correct calcualtion. If the list item is not complete it should check the SLA date time against NOW(). If it is complete then it will use 'SharePoint List'[Modified].

 

The expression below was working yesterday but now does not as the function DATEVALUE() removes the time element, converting that to 00:00.

 

WithinSLA = IF('SharePoint List'[Status]="Investigation", "Investigation", IF('SharePoint List'[Status]="Completed", IF(DATEVALUE('SharePoint List'[Modified])<DATEVALUE('SharePoint List'[SLA Date]), "Yes", "No"), IF(NOW()<DATEVALUE('SharePoint List'[SLA Date]), "Yes", "No")))

I am obviously missing something or is there another way to do what I want to do?

1 ACCEPTED SOLUTION

Within SLA = 
IF(
	'Data Services Dataset List'[Status]="Investigation", "Investigation", 
	IF(
		'Data Services Dataset List'[Status]="Completed", 
		IF(
			VALUE('Data Services Dataset List'[Modified]) <= VALUE('Data Services Dataset List'[SLA Date]), "Yes", "No"
		), 
		IF(
			VALUE(NOW()) <= VALUE('Data Services Dataset List'[SLA Date]), "Yes", "No"
		)
	)
)

Resolved with the above. Thanks for your help.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @mark_carlisle,


Your formula seems well, have you double check you columns to confirm if they can convert to date by datevalue function?
In addtion, you can also try to use switch function with today fuction to check value:

 

WithinSLA =
SWITCH (
    'SharePoint List'[Status],
    "Investigation", "Investigation",
    "Completed", IF (
        DATEVALUE ( 'SharePoint List'[Modified] )
            < DATEVALUE ( 'SharePoint List'[SLA Date] ),
        "Yes",
        "No"
    ),
    IF ( TODAY () < DATEVALUE ( 'SharePoint List'[SLA Date] ), "Yes", "No" )
)

If above not help, please share some sample data to test.

 

 

Regards,

Xiaoxin Sheng

Within SLA = 
IF(
	'Data Services Dataset List'[Status]="Investigation", "Investigation", 
	IF(
		'Data Services Dataset List'[Status]="Completed", 
		IF(
			VALUE('Data Services Dataset List'[Modified]) <= VALUE('Data Services Dataset List'[SLA Date]), "Yes", "No"
		), 
		IF(
			VALUE(NOW()) <= VALUE('Data Services Dataset List'[SLA Date]), "Yes", "No"
		)
	)
)

Resolved with the above. Thanks for your help.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors