← All posts
5 min read

Comparing Year-To-Date Financial Data Across Years

It is July and leadership wants to know: how does this year compare to last year? Not full-year totals, because the year is not over. They want a fair comparison -- January through June 2024 versus January through June 2023 -- broken down by product category. Which categories are growing? Which are declining? By how much?

This is a year-over-year (YoY) comparison, and it normally requires a SQL query with self-joins or a BI tool with calculated fields. In ExploreMyData, you can build it with a multi-view pipeline. Here is how.

What you need

An orders or transactions file spanning at least two calendar years. You need columns for order_date, category (or product, region, etc.), and revenue (or whatever metric you are comparing).

Step 1: Extract year and month

Open the toolbar and select Extract Date from the Transform group. Apply it twice:

  1. Extract year from order_date → name it order_year
  2. Extract month from order_date → name it order_month

Now every row has a year number and a month number. This is what makes the comparison possible -- you can match January 2024 to January 2023 by joining on the month number.

order_idorder_datecategoryrevenueorder_yearorder_month
ORD-22102023-02-14Software4,200.0020232
ORD-48012024-02-09Software5,100.0020242
ORD-48022024-03-22Hardware8,750.0020243

Extract Date stamps every row with the numeric year and month - the join key that lets you match January 2024 to January 2023.

Step 2: Filter to the comparison months

Select Filter from the Filter & Sort group:

  1. Column: order_month
  2. Operator: less than or equal to
  3. Value: 6

This keeps only January through June for both years. The comparison is now fair: you are comparing the same months, not a full year against a partial year. Adjust the cutoff month based on how much of the current year has elapsed.

Step 3: Create two views

This is where ExploreMyData's multi-view feature comes in. From the filtered dataset, create two separate views:

View A (this year): Add a Filter step where order_year = 2024. Then add a Group By step: group by category and order_month, and aggregate SUM(revenue). Name the sum column revenue_2024.

View B (last year): Same steps but filter where order_year = 2023 and name the sum column revenue_2023.

Each view now has one row per category per month with the total revenue for that year.

View A - 2024 (Jan–Jun), grouped by category + month

categoryorder_monthrevenue_2024
Software162,400.00
Hardware141,800.00
Services128,950.00

View B - 2023 (Jan–Jun), grouped by category + month

categoryorder_monthrevenue_2023
Software154,100.00
Hardware145,200.00
Services124,300.00

Same shape, different year. The join step combines them into one row per category per month with both revenue columns side by side.

Step 4: Join the two years together

Select Join from the Combine group. Configure it:

  1. Left view: View A (2024)
  2. Right view: View B (2023)
  3. Join type: Inner (or Left, if you want to see categories that exist in 2024 but not 2023)
  4. Join on: category = category AND order_month = order_month

The result is a table with one row per category per month, with both revenue_2024 and revenue_2023 columns side by side.

Step 5: Calculate the year-over-year change

Select Math from the Transform group. Create a new column with the formula:

(revenue_2024 - revenue_2023) / revenue_2023 * 100

Name it yoy_change_pct. A value of 15 means 15% growth. A value of -8 means an 8% decline.

If you also want the absolute dollar change, add another Math column: revenue_2024 - revenue_2023 and name it yoy_change_abs.

Step 6: Label the growth direction

Select Add Column from the Columns group. Use a conditional expression to create a human-readable label:

  • If yoy_change_pct > 2 → "Growing"
  • If yoy_change_pct < -2 → "Declining"
  • Otherwise → "Flat"

Name it trend. The 2% threshold avoids labeling minor fluctuations as meaningful trends. Adjust the threshold to whatever makes sense for your business.

categoryorder_monthrevenue_2024revenue_2023yoy_change_pcttrend
Software162,400.0054,100.0015.3Growing
Hardware141,800.0045,200.00-7.5Declining
Services128,950.0024,300.0019.1Growing
Training19,100.008,950.001.7Flat

Software and Services are growing; Hardware is declining 7.5% YoY. Sort by yoy_change_pct to rank categories from fastest growth to steepest decline.

Reading the results

Sort by yoy_change_pct descending to see your fastest-growing categories at the top. Sort ascending to see the biggest declines. Filter to trend = 'Declining' to focus on problem areas.

For a summary view, you can add a Group By at the end: group by category, sum revenue_2024 and revenue_2023, then recalculate the YoY change on the totals. This gives you one row per category with the full H1 comparison.

The full pipeline

  1. Extract Date - year and month from order_date
  2. Filter - months 1 through 6 only
  3. Two views - one filtered to 2024, one to 2023, each grouped by category + month
  4. Join - on category and order_month
  5. Math - (revenue_2024 - revenue_2023) / revenue_2023 * 100
  6. Add Column - trend label based on change threshold

Next quarter, update the month filter to include July through September and the pipeline recalculates everything. Swap in a different file with different categories and it still works. The pipeline does not care about the specific data -- it cares about the structure.

Compare your year-over-year data →

Try it yourself

No sign-up, no upload, no tracking.

Open ExploreMyData