Showing results for 
Search instead for 
Did you mean: 
Post Patron
Post Patron

help with a formula to filter the sum of a calculation


I am trying to perform what is seemingly an easy calculation but I cannot get there in DAX.

I am reading several forecats files, to which I give a version: "n" for this month, "n-1" for last month, etc.

I also have an actual spending table, with spending per month up to the latest month of available data (so no versioning). 

What I need to do it to be able to sum up the actuals but only up to the date of the version selected (or version used as a legend in a chart is what I would like to achieve, to show the different curves of forecast + actual per month by file version).


I have a table with file versions that I am reading, that I have now included in my date table (which I hope is the correct way of doing thigs):




The Actuals table just has 4 columns: Project Number, Date, Spending and Year


then I have tried to created a measure for summing the actuals, but it is not working 😞


Spending Versioned (US$) =
VAR VersionSelected = (SELECTEDVALUE(DateTable[EOM Date]))
VAR ActualsAmount = CALCULATE(SUM('ACTUALS'[Spending USH$]),


Can you please guide me in how to do this properly?



Kind regards



Memorable Member
Memorable Member

Hi @ValeriaBreve  check bracket at start and at end in part VAR VersionSelected = (SELECTEDVALUE(DateTable[EOM Date])). I hope this help.

Sarajevo, Bosnia and Herzegovina

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors