Forum Discussion
Filter Context with YTD Calculation
I am struggling to come up with a DAX Formula to help me with creating a YTD column based on 1 condition.
I have the table [Actuals-Plan] which has the following relevant columns
- Amount: $ amount
-Date: various dates (Some are for the same day but different account)
- PlanActual: This column has either "Plan" or "Actual"
In my data i have 12 months woth of Plan data
I am trying ot develop a YTD / Running Total for just the "Actuals", but i cant seem to get it to work. Would anyone be able to assist me with understanding how to write this DAX formula and explain how the filter context works in this scenario?
Thanks and please let me know if you have any questions.
2 Replies
- Greg_Deckler
Community Champion
- JgrohowsFrequent Visitor
Thank you very much! The second link put me in a much better position, but i am not understanding why I am still getting datafor "Plan", when i specifically filtered it out in my DAX Formula.
TEST =Var _Date= MAX('Actuals-Plan'[Date])Var _Table= Filter(ALLSELECTED('Actuals-Plan'),'Actuals-Plan'[Date]<=_Date && 'Actuals-Plan'[PlanActual]="Actual")RETURNSUMX(_Table,'Actuals-Plan'[Amount])Here is the result. I only want to show the column "Actuals".