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 / Convert datetime colum...
Power Apps
Unanswered

Convert datetime column into year column

(0) ShareShare
ReportReport
Posted on by

Hello guys, I need your help.

 

I've a column of datetime in Sharepoint list. I want to use this column to create dropdown of a year in the list. 

This is what i want.

BaywareNNN_2-1670583145537.png

 

 

What I think is I need to create a collection from Sharepoint list with datetime column and convert this column in to year (use Year function) then use Distinct function to filter out the duplicate.

 

My collection name yearyear and the column name is DateofOccurence.

BaywareNNN_0-1670582990092.png

 

The problem is Year function is not enable to convert table.   

BaywareNNN_1-1670583108381.png

 

 

Please help me to convert my datetime column in the collection to year column.

 

Or any advise to complete this is very helpful.

 

Thanks.

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Anonymous 

     

    You could add the following code to the Items property of your dropdown:

    Distinct(
     AddColumns(
     colDates,
     "Year",
     Year(ThisRecord.Value)
     ),
     Year
    )

     

    However, you could also fix this by creating a year collection and using the distinct of those values:

     

    ForAll(
     colDates,
     Collect(
     colYearOfDates,
     Year(ThisRecord.Value)
     )
    )

     

    I hope this helps!

  • Community Power Platform Member Profile Picture
    on at

    Thanks!!! LaurensM

     

    This is really solved my problem.

     

    Wish you have a good day!

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