
Announcements
Dear All,
Trying to figure out how to go about this. I have a SharePoint list as shown below;
My question is
1. How can i Group the information by year as shown below
The would will be in a gallery container.
2. Would like to add a checkbox (cb) to view upcoming years only. For instance, If the current year is 2022, When you select the checkbox, The gallery container only displays 2023 and later years.
3. Is it possible to group the Title and also the amount while using a drop-down (Year). See below.
The above image (Gallery 2 View), Shows only the amount of AA1 for 2021.
Thanks.
Hi @caslasgee
You can achieve this with a combination of the "AddColumns" and "GroupBy" functions. First, you will need to extract the year value from the data, and then you can apply filters and group actions.
To address questions 1 and 2, you can use the following formula
With({data:GroupBy(AddColumns(ListA,"year",Year(Date)),"year","yearData")},If(cb.Value,Filter(data,year>Year(Now())),data))For the last question, you can use the group by with 2 columns as shown below:
GroupBy(Filter(AddColumns(ListA,"year",Year(Date)),year = Dropdown1.Selected.Value),"year","Title","yearData")
Make sure to calculate the sum in the gallery for the label, as shown below:
Sum(ThisItem.yearData,YearlyBudget)