Forum Discussion
C4L84
4 years agoAdvocate II
TOTALYTD variable year
Hi I need to pass thorugh a variable year end to TOTALYTD, however it's not working as hoped: Running Total Spend = VAR _EndDate = FORMAT(MAX('FY end'[Date]), "DD/MM") RETUR...
- 4 years ago
Hi C4L84
Here is the file with the solution https://we.tl/t-LZzcXfkSG3
Your Mesure Code isRunning Total Spend = VAR _EndDate = MAX ( 'FY end'[Date] ) VAR _CurrentYear = SELECTEDVALUE ( 'Calendar'[Financial year] ) VAR _StartDate = DATE ( _CurrentYear, MONTH ( _EndDate ), DAY ( _EndDate ) ) VAR _CurrentDate = MAX ( 'Calendar'[Date] ) VAR _Result = CALCULATE ( SUM ( Sheet1[Spend] ), 'Calendar'[Date] >= _StartDate, 'Calendar'[Date] <= _CurrentDate ) RETURN _Result
C4L84
4 years agoAdvocate II
In this instance the last arguement is not a fixed number, I have a parameter in the pbix that changes the 'FY End'[Date].
The year portion isn't required in the TOTALYTD year end arguement: