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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CloudMonkey
Post Prodigy
Post Prodigy

If statement for date giving wrong answer

Hi,

 

In the screenshot below I have a date field (first column) created using the CALENDARAUTO() function. The last field PricingTrialBeforeDuringOrAfter should flag each record as being "Before" or "During" the pricing trial period which started on the 5th June 2017. The if formula is shown in the formula bar in the screenshot below. My problem is that the formula is incorrectly flagging records from 31 December 1899 as "During", whereas it should be lableing records from 5th June 2017 as "During". Please could you tell me how to fix it?

 

Capture calendar.JPG

 

Thanks,

 

CM

2 ACCEPTED SOLUTIONS
Interkoubess
Solution Sage
Solution Sage

Hi @CloudMonkey,

 

Please add date to the date as below

 

PricingTrialBeforeDuringorAfter=IF([Dare].[Date]>date(2007,06,05),"During","Before")

 

Ninter

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF([Date]>DATE(2017,6,5),"During",Before")

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF([Date]>DATE(2017,6,5),"During",Before")

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Interkoubess
Solution Sage
Solution Sage

Hi @CloudMonkey,

 

Please add date to the date as below

 

PricingTrialBeforeDuringorAfter=IF([Dare].[Date]>date(2007,06,05),"During","Before")

 

Ninter

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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