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 / Get YEAR and compare w...
Power Apps
Answered

Get YEAR and compare with dropdown Year for filter

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to get the year from a date in dataverse. Then compare that year to the text dropdown I have for the years to be able to filter the list.  For some reason, the line in RED is giving me issues (probably because I don't know what I am doing) 

 

 

 

rlavigne99_0-1632268194872.png

rlavigne99_1-1632268344880.png

 

rlavigne99_2-1632268470728.png

No Idea what I am doing wrong. I feel like its me not understanding how a date gets converted to a number or text that I can use to compare with the text from the dropdown. 

 

 

SortByColumns(
 If(Text(DropdownPPYear.Selected.Value) = "All",
 Filter(
 'ITCosting PrePaid Schedules',
 PmtMonthDate >= DateAdd(Now(),1, Years) && 
 VendorSearchInput.Text in Vendor
 ),
 Filter(
 'ITCosting PrePaid Schedules',
 Text(Value(Year(PmtMonthDate))), >= Value(DropdownPPYear.Selected.Value) && 
 VendorSearchInput.Text in Vendor 
 )
 ),

"crd83_pmtmonthdate", 
SortOrder.Ascending 
) 

 

rlavigne99_3-1632268592643.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    mate_toth Profile Picture
    98 on at

    Hi @Anonymous , 

    It looks like there is an extra comma after the ValuePmtMonthDate))), and the Text isn't needed. Can you try with this one?

    Value(Year(PmtMonthDate)) >= Value(DropdownPPYear.Selected.Value)

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This was the final code that seems to have worked properly. I thank you for your help. I hate commas! haha

    SortByColumns(
     If(Text(DropdownPPYear.Selected.Value) = "All",
     Filter(
     'ITCosting PrePaid Schedules',
     VendorSearchInput.Text in Vendor &&
     PmtMonthDate >= DateAdd(Now(),0, Years) 
     
     ),
     Filter(
     'ITCosting PrePaid Schedules',
     Value(Year(PmtMonthDate)) >= Value(DropdownPPYear.Selected.Value) &&
     // Text(Value(Year(PmtMonthDate))), >= Value(DropdownPPYear.Selected.Value) && 
     VendorSearchInput.Text in Vendor 
     )
     ),
    
    "crd83_pmtmonthdate", 
    SortOrder.Ascending 
    ) 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard