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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors