Cumulative Sum for the Year on a table card

I want to create a table card that has a line for each month-year for all sales and show total $ for the month, a running total of $ for the year (up to that point), total quantity sold for the month, and a running total of quantity sold for the year (up to that point).

Example:

Month-Year | Monthly $| Running $ | Monthly Quantity | Running Quantity
January 2024 | $100 | $100 | 10 | 10

February 2024 | $50 | $150 | 5 | 15

….

December 2024 | $100 | $1200 | 10 | 120

January 2025 | $30 | $30 | 3 | 3

February 2025 | $20 | $50 | 2 | 5

If you use the "Show Value As" parameter when you click on the variable in the card, it does not allow you to group the data at all so it just adds every line up over every year.