Skip to main content

 

Hi Pigment Community 👋,

I’m working with a table that contains monthly revenue data across several years. My goal is to build a logic that, for each month, returns the latest available revenue value for that specific month, even if it comes from a previous year.

🎯 Objective

For each Month (e.g. Jan, Feb, … Dec), I want to retrieve the most recent actual revenue that is available for that calendar month, regardless of the year.

Example:

Month Latest Revenue
Mar Mar 2025
Apr Apr 2025
... ...
Sep Sep 2024
Oct Oct 2024
Nov Nov 2024
Dec Dec 2024
Jan Jan 2025
Feb Feb 2025

 

So in September 2025, for example, the latest available revenue for September would still be September 2024, if no more recent actual exists for September 2025 yet.

 

📈 Why I'm doing this

I want to build a metric that compares Budget vs Actuals across future years, but always using the latest 12 months of actual revenue as the baseline.

That means I need a view where, for each calendar month, I can reference the most recent actual revenue available — and then use that to calculate year-over-year variations.

 

EXAMPLE

 

Below would be the matrix per year that combines the most recent actuals per month. The first semester of the year is 2025 actuals and the second semester of the year is 2024 actuals

 

 

January February March April May June July August September October November December
Jan-25 Feb-25 Mar-25 Apr-25 May-25 Jun-25 Jul-24 Aug-24 Sep-24 Oct-24 Nov-24 Dec-24
424 260 271 827 988 721 655 702 322 208 815 858

 

Then I need to compare the actual baseline of the last 12 months with the output of the budget model:

 

  Jul-25 Aug-25 Sep-25 Oct-25 Nov-25 Dec-25 Jan-26 Feb-26 Mar-26 Apr-26 May-26 Jun-26 Jul-26 Aug-26 Sep-26 Oct-26 Nov-26 Dec-26
Budget 578 527 976 548 546 967 629 761 1087 842 873 436 1238 320 1136 518 789 879
Actual (last 12 months base) 655 702 322 208 815 858 424 260 271 827 988 721 655 702 322 208 815 858

 

 

🧩 What I’ve tried

'Revenue' aBY LASTNONBLANK: Month.'Month of Year'] OBY: Month.'Month of Year']

This result repeats the same values for each month of the year as expected but the numbers are wrong, they include values from previous years (2023 or 2022) that I don’t need.

 

🙏 Any suggestions?

Has anyone tackled something similar — selecting the latest value available per month name, across years?

Thanks in advance!


Laura

Be the first to reply!

Reply