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 / dropdown with dates
Power Apps
Answered

dropdown with dates

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Given a dropdown where each element is like 2020/08 and so on.

I want to do a if statement where i compare the value of the element in the dropdown with the actual date if it is smaller than the actual date ? 

 

How can i achieve this ? 

Akki2995_0-1690878309078.png

 

Categories:
I have the same question (0)
  • Verified answer
    v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    May I ask what is the Items of DropDown?

    Let us assume it below.

    vhanytianmsft_0-1690878967182.png

    Insert a TextLabel for showing the result.

    If(DateDiff(Today(),Dropdown2.Selected.Value,TimeUnit.Months)>0,true,false)

     

    vhanytianmsft_1-1690878982638.png

     

    Hope this will help you,

    Best Regards,
    Tina

  • JatinSaini Profile Picture
    428 on at

    There you go, 

    I have used this condition under a Text Label Control. You could use it anywhere you feel like but make sure you adjust the code as per your requirement:

     

    If(IsBlank(Dropdown1.Selected.Value),Text( Today(), "yyyy/mm" ),If(DateValue(Dropdown1.Selected.Value)<Today(),Text( Today(), "yyyy/mm" ),Dropdown1.Selected.Value))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard