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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
skorpion
Helper I
Helper I

If Statement with AND & today Funcation

I have query where im trying to if condition but im getting error please anyone can help me out on this Thanks

 

=(if(today()>=[start] and today() <=[end]) then [#"%Total_plan"] else "0")

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi skorpion ,

 

In M query:

 = if [start] <= DateTime.Date(DateTime.LocalNow())  and [end] >= DateTime.Date(DateTime.LocalNow()) then  [#"%Total_plan"] else "0"

 

In DAX:

Result =
IF ( TODAY () >= [start] & TODAY () <= [end], [#"%Total_plan"], "0" )

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi skorpion ,

 

In M query:

 = if [start] <= DateTime.Date(DateTime.LocalNow())  and [end] >= DateTime.Date(DateTime.LocalNow()) then  [#"%Total_plan"] else "0"

 

In DAX:

Result =
IF ( TODAY () >= [start] & TODAY () <= [end], [#"%Total_plan"], "0" )

Regards,

Jimmy Tao

SteveCampbell
Memorable Member
Memorable Member

Are you in the query editor? Or are your writing a DAX statement?

 



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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