I have Sharepoint list called “Revenue Data” similar to this revenue table and I would like to filter my gallery by year and quarter. When I originally created the app, I only had data for 2021 and I filtered the gallery by quarter and month with no problem using the groupby function. However, now that we are starting to add data for 2022, I want to filter by year and quarter, but cannot seem to get it to work right. What am I doing wrong?
ClientName | Year | Month | Quarter | Revenue | Expenses | | | | |
A | 2021 | January | 1 | $ 20,000.00 | $ 12,000.00 | | | | |
A | 2021 | February | 1 | $ 16,000.00 | $ 7,000.00 | | | | |
A | 2021 | March | 1 | $ 17,500.00 | $ 9,200.00 | | | | |
B | 2021 | January | 1 | $ 22,000.00 | $ 13,000.00 | | | | |
B | 2021 | February | 1 | $ 25,000.00 | $ 11,000.00 | | | | |
B | 2021 | March | 1 | $ 31,000.00 | $ 9,500.00 | | | | |
A | 2021 | April | 2 | $ 22,000.00 | $ 14,000.00 | | | | |
A | 2021 | May | 2 | $ 19,000.00 | $ 7,000.00 | | | | |
A | 2021 | June | 2 | $ 24,000.00 | $ 8,200.00 | | | | |
B | 2021 | April | 2 | $ 34,000.00 | $ 9,800.00 | | | | |
B | 2021 | May | 2 | $ 24,000.00 | $ 6,800.00 | | | | |
B | 2021 | June | 2 | $ 26,000.00 | $ 7,400.00 | | | | |
A | 2021 | July | 3 | $ 23,000.00 | $ 9,500.00 | | | | |
A | 2021 | August | 3 | $ 29,000.00 | $ 16,000.00 | | | | |
A | 2021 | September | 3 | $ 18,000.00 | $ 12,000.00 | | | | |
B | 2021 | July | 3 | $ 24,000.00 | $ 11,000.00 | | | | |
B | 2021 | August | 3 | $ 21,000.00 | $ 8,700.00 | | | | |
B | 2021 | September | 3 | $ 29,000.00 | $ 11,600.00 | | | | |
A | 2021 | October | 4 | $ 20,500.00 | $ 12,000.00 | | | | |
A | 2021 | November | 4 | $ 27,000.00 | $ 13,000.00 | | | | |
A | 2021 | December | 4 | $ 28,500.00 | $ 11,000.00 | | | | |
B | 2021 | October | 4 | $ 35,500.00 | $ 9,500.00 | | | | |
B | 2021 | November | 4 | $ 15,000.00 | $ 4,900.00 | | | | |
B | 2021 | December | 4 | $ 26,000.00 | $ 8,600.00 | | | | |
A | 2022 | January | 1 | $ 21,000.00 | $ 7,000.00 | | | | |
A | 2022 | February | 1 | $ 18,000.00 | $ 8,500.00 | | | | |
B | 2022 | January | 1 | $ 23,000.00 | $ 7,600.00 | | | | |
B | 2022 | February | 1 | $ 24,000.00 | $ 9,000.00 | | | | |
Dropdown1 = Year
Dropdown2 = Quarter
Here is my gallery items formula:
AddColumns(GroupBy(Filter(‘RevenueData’, Quarter =Dropdown2.Selected.Result), "ClientName", "Quarter","DATA"),"REV",Sum(DATA, ‘Revenue’),"EXP",Sum(DATA,’Expenses'))