Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Save single column of dates into a collection based on the month

(0) ShareShare
ReportReport
Posted on by

Wasn't exactly sure how to title this post so forgive me if it didn't make much sense. Hopefully, either my explanation or example will be able to help you understand my question. 

With that said, I currently have a Share Point list that has a Date/Time Column named Date (dd/mm/yyyy). It is full of different dates from throughout the year. I was wondering if/how I can take that single column of dates and add them to a collection, sorting them into columns based on the month. It's probably a simple solution but for some reason I can't seem to think of a way to do it, so any help will be greatly appreciated.

 

Example

 

What I have currently inside a SharePoint column 

Date
01/04/2022
01/01/2022
01/02/2022
01/06/2022
01/08/2022
01/11/2022
01/07/2022
02/01/2022
13/07/2022

 

What I want as a collection in PowerApps

JanFebMarAprilMayJuneJulyAugSepOctNovDec
01/01/202201/02/2022 01/04/2022 01/06/202201/07/202201/08/2022  01/11/2022 
02/01/2022     13/07/2022     

 

I am posting this late on a Friday afternoon so I apologise if I go silent for a couple days.

Categories:
  • MathewM Profile Picture
    on at
    Re: Save single column of dates into a collection based on the month

    @v-yujincui-msft Thanks for the help, this works great!

  • Verified answer
    v-yujincui-msft Profile Picture
    on at
    Re: Save single column of dates into a collection based on the month
    DataSource, Switch( Month(ColumnName), 1,Collect(CollectionName,{'1Jan': Text(ColumnName)}), 2,Collect(CollectionName,{'2Feb': Text(ColumnName)}), 3,Collect(CollectionName,{'3Mar': Text(ColumnName)}), 4,Collect(CollectionName,{'4April': Text(ColumnName)}), 5,Collect(CollectionName,{'5May': Text(ColumnName)}), 6,Collect(CollectionName,{'6June': Text(ColumnName)}), 7,Collect(CollectionName,{'7July': Text(ColumnName)}), 8,Collect(CollectionName,{'8Aug': Text(ColumnName)}), 9,Collect(CollectionName,{'9Sep': Text(ColumnName)}), 10,Collect(CollectionName,{'10Oct': Text(ColumnName)}), 11,Collect(CollectionName,{'11Nov': Text(ColumnName)}), 12,Collect(CollectionName,{'12Dec': Text(ColumnName)}) ) )

    vyujincuimsft_0-1645424082343.png

     

    Best Regards,

    Charlie Choi

    Hi @MathewM ,

     

    Please try the following formula:

    ForAll(
                          

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard