web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formula: how to compar...
Power Apps
Unanswered

Formula: how to compare a Date Only column with a given Month?

(0) ShareShare
ReportReport
Posted on by 286
Hello guys,
 
I'm trying to get something like 
 
If('Start Date' > Date(2025, 1, 1), 10, 0).
 
'Start Date' is a column in my table. The date, I'd like to hard-code. 
 
Does anyone know how to do this in the Dataverse? 
 
It's a Formula column.
 
Thank you!
 
Alice
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    What is the problem that is occurring?
    Where is the month value which you are trying to compare?
  • AliceW Profile Picture
    286 on at
    Well, the problem is the formula won't save with this text.
    'Start Date' is a Date Only column in the table.
    I want to compare it with 1-Jan-2025.
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Date is not a valid function.
     
    Why do you want to compare it to a fixed value in the table?
  • AliceW Profile Picture
    286 on at
    Long story... I basically want to stop some columns from calculating if after, say, January. 
  • Akah Mandela Profile Picture
    445 on at
    can you try this instead:

    If(
        DateValue('Start Date') > Date(2025, 1, 1),
        10,
        0
    )
     
  • Suggested answer
    ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    The following suggestion is clumsy and hacky and is dependent on whether you are using time zone independent dates. You can create the static date using the DateAdd function subtracting today's date and adding the date which you want.
     
    DateAdd(DateAdd(DateAdd(UTCToday(), 2025 - Year( UTCToday()), TimeUnit.Years), 1 - Month( DateAdd(UTCToday(), 2025 - Year( UTCToday()), TimeUnit.Years)), TimeUnit.Months), 1 - Day( DateAdd(DateAdd(UTCToday(), 2025 - Year( UTCToday()), TimeUnit.Years), 1 - Month( DateAdd(UTCToday(), 2025 - Year( UTCToday()), TimeUnit.Years)), TimeUnit.Months)), TimeUnit.Days) 
    is a substitute for Date(2025,1,1)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard