Set Up the Gallery
Ensure your gallery is sorted by the Month/Year field. You can do this by setting the Items property of the gallery to:
SortByColumns('Contracts Lists', "Start", Ascending)
mm/yyyy Text Field
Add a label inside the gallery to display the Month/Year:
Text(ThisItem.Start, "mm/yyyy")
Savings ($$) Field
Add a label inside the gallery to display the savings for each month:
Sum(Filter('Contracts Lists', Text(Start, "mm/yyyy") = ThisItem.Start), Savings)
Running Total of Savings Field
Add a label inside the gallery to display the running total. Set the Text property of this label to:
Sum(Filter('Contracts Lists',
DateValue(Text(Start, "mm/yyyy")) <= DateValue(Text(ThisItem.Start, "mm/yyyy"))),
Savings)
This formula works as follows:
- Filter('Contracts Lists', DateValue(Text(Start, "mm/yyyy")) <= DateValue(Text(ThisItem.Start, "mm/yyyy"))): Filters the contracts list to include all records up to and including the current month/year.
- Sum(..., Savings): Sums the Savings field for the filtered records.