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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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]

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]

@Syndicate_Admin Will the solution be reviewed/accepted?

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Solution Authors
Top Kudoed Authors