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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Brash1
Regular Visitor

Trying to figure out the error

Hello, 

Trying to figure out this error

 

Trying to figure out days between current date and request date for items that do not have a finish date, getting an expression error We cannot apply field access to the type Function.
Details:
Value=[Function]
Key=Current Date

 

This is my current expression

if [#"Finish Date #(lf)"]= null then Duration.Days[Current Date]-[Request Date] else 0

 

Thanks in Advance

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Brash1 ,

 

Try something like this:

if [#"Finish Date #(lf)"] = null
then Duration.Days(Date.From(DateTime.LocalNow()) - [Request Date])
else 0

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
Brash1
Regular Visitor

Thanks Pete, I think this solution worked.

 

Brilliant! Glad that's worked for you.
Don't forget to give a thumbs-up on any posts that have helped you 👍

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi @Brash1 ,

 

Try something like this:

if [#"Finish Date #(lf)"] = null
then Duration.Days(Date.From(DateTime.LocalNow()) - [Request Date])
else 0

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Kudoed Authors