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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

DateTime.LocalNow - returns "Function"

Hi, 

 

Below is the data for which I want to get today's date, if it's in current month. I wrote a formula, which is returning as "Function" in cell value. How to get Today's date in the cells. 

if Date.IsInCurrentMonth([End Date])=true then DateTime.LocalNow else [End Date]

End DateRequired date

12/01/2023

12/22/2023

11/01/2023

11/01/2023

10/01/202310/01/2023

 

When I click on Function it goes to invoked function and shows current time and date. Please help me with this. 

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

Hello! Please try this:

if Date.IsInCurrentMonth([End Date]) then Date.From(DateTime.LocalNow()) else [End Date]

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

View solution in original post

4 REPLIES 4
jennratten
Super User
Super User

Hello! Please try this:

if Date.IsInCurrentMonth([End Date]) then Date.From(DateTime.LocalNow()) else [End Date]

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

@Syndicate_Admin Will the solution be reviewed/accepted?

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Syndicate_Admin
Administrator
Administrator

You are close if Date.IsInCurrentMonth([End Date])=true then DateTime.LocalNow() else [End Date]
ronrsnfld
Super User
Super User

You are close:

if Date.IsInCurrentMonth([End Date])=true then DateTime.LocalNow() else [End Date]

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.

Top Solution Authors