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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display Mode and date ...
Power Apps
Answered

Display Mode and date comarison

(0) ShareShare
ReportReport
Posted on by 26

I am trying to disable editing if a date in the gallery is less than todays date. I have added a label with the date that is being pulled from my sql source. 

In the displayMode property I added this code If(Value(Today())>Value(Label1.Text),DisplayMode.Disabled,DisplayMode.Edit)

I am getting no error but it is not working correctly and then I click on Label.text is says it's blank when there is dates on the screen.

Categories:
I have the same question (0)
  • Fredrik_A Profile Picture
    3,644 Super User 2026 Season 2 on at

    I tried with the following formula which worked as expected, try using the following but switch Now() to your date column:

    If(Today()>Now(),DisplayMode.Edit,DisplayMode.Disabled)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @kathrinfitts

    Do you want to compare the today with the date value from your sql table?

    Could you please tell me post a screenshot to describe if the it is a date time value or date only value?

     

    Actually, I suggest you compare the today date directly with the formula you set for the Label Text property if you have a date only value from sql table.

    If(Today()><Formula_For_Label_Text>,Disabled,Edit)

    Note that this works only when you have a date only value from your sql table.

     

    I don't agree with @StretchFredrik that we could compare Today() with Now() because they have different data type, which one is date only value and the other one is a date time value.

    If you have a date time value from sql table, you could convert the date time value into a date only value to compare with the Today()

    If(Today()>DateValue(Text(First(BU).Created,"dd/mm/yyyy")),Disabled,Edit)​

    Note that First(BU).Created is the date time value from my data source, and I combine Text() with DateValue() to convert it into a format like "dd/mm/yyyy"

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard