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 / GroupBy various dates ...
Power Apps
Answered

GroupBy various dates into month column

(0) ShareShare
ReportReport
Posted on by 482

Hey there

 

I have the following source:

NameDateCategory
Car4/9/2020 12:00 AMLand
Bicycle5/25/2020 12:00 AMLand
Jetski5/4/2020 12:00 AMWater
Boat7/13/2020 12:00 AMWater
Ship7/4/2020 12:00 AMWater
Airplane7/20/2020 12:00 AMAir
Truck7/25/2020 12:00 AMLand

 

Out of the above source, is it possible to get a collection which looks something like the following?:

 

MonthCategories
April
CategoryTransactions
Land
NameDateCategory
Car4/9/2020 12:00 AMLand
May
CategoryTransactions
Land
NameDateCategory
Bicycle5/25/2020 12:00 AMLand
Water
NameDateCategory
Jetski 5/4/2020 12:00 AMWater
July
CategoryTransactions
Water
NameDateCategory
Boat7/13/2020 12:00 AMWater
Ship7/4/2020 12:00 AMWater
Air
NameDateCategory
Airplane7/20/2020 12:00 AMAir
Land
NameDateCategory
Truck7/25/2020 12:00 AMLand

 

Kind regards,

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @mrQ , 

    You are requesting a three level nested gallery.  At the present time, there is a maximum of two levels permitted, only a single gallery and subgallery.   This feature has been requested as a new feature but there was a work around for it posted here. https://powerusers.microsoft.com/t5/Building-Power-Apps/Looking-for-ideas-on-a-workaround-for-the-nested-gallery-limit/td-p/264183 .  If you want to vote for this feature to be added, please go to https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Nested-Galleries-Expand-Limit-to-At-Least-3-Nested-Galleries/idi-p/206920  in the Ideas section of the forum.

  • Verified answer
    rebeccas Profile Picture
    2,591 on at

    @mrQ 

     

    You can but you can make it display in galleries like that. Not sure what you need it to do. Here is how:

     

    Gallery 1:

     

    SortByColumns(GroupBy(AddColumns(DataSource, "DateMonth", Month(DateField),"DateYear",Year(DateField)),"DateMonth","DateYear","GrpByDAte"),

    "DateYear",Ascending,"DateMonth",Ascending)

     

    This gallery can have two labels in it: 

    1)Switch(ThisItem.DateMonth,
    1, "Jan",
    2, "Feb",
    3, "Mar",
    4, "Apr",
    5,"May",
    6, "Jun",
    7, "Jul",
    8, "Aug",
    9, "Sep",
    10, "Oct",
    11, "Nov",
    12, "Dec",
    "")

     

    2) ThisItem.DateYear

     

    The OnSelect for them needs to be: Set(varMonth, ThisItem.DateMonth); Set(varYear, ThisItem.DateYear)

     

    Then you can have a second gallery that groups by the categories but also filters for only ones who have the Month and Year matching the variable you set on Gallery 1 OnSelect.--- The Filter portion would be something like: Filter(DataSource, Month(DateField) = varMonth && Year(DateField) = varYear)

     

    The third gallery could not have any grouping...just filtering off the date variables and then a variable set off the "Category" selected in Gallery 2. It just really depends on what all you need do with it...there are a few ways you could make this work. 

     

    The one I did just has several layers of filtering so it gets a similar result you are wanting but a different way of going about it. Just have to think outside the box. 

     

    I have one that does a collection of all the data and each time they make a selection (from a gallery) it removes the items that do not fit that criteria....allowing them to filter multiple fields. 

     

  • mrQ Profile Picture
    482 on at

    Thanks for the hint.

     

    How could I achieve it with 2 nested tables?

  • mrQ Profile Picture
    482 on at

    just saw this. I'm going to try it out tomorrow, thanks!

    I'll keep you posted

     

    ** Update **

    This works great. Thank you!

  • javkhaa0523 Profile Picture
    19 on at

    it worked, thanks for detailed demonstration

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#2
11manish Profile Picture

11manish 186

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 105 Super User 2026 Season 1

Last 30 days Overall leaderboard