Forum Discussion

akkitek's avatar
akkitek
Helper III
4 years ago
Solved

TotalYTD function returning error

Hey All,
I have a column with values and a column with dates (image below). I'm trying to create a simple measure calculating the YTD sum of the values. I tried the following measure: 

ODC Expense YTD = TOTALYTD(SUM(FACT_Fin_Data_by_Mo[ODC Expense]),FACT_Fin_Data_by_Mo[Month])
but I get the following error:

I've tried many diffrent variations of this calculation but keep getting the same error. 

 

Any help is appreciated. Thanks:)

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  akkitek ,

    You can try to change the formula to the following form:

    ODC Expense YTD =
    CALCULATE(SUM('FACT_Fin_Data_by_Mo'[ODC Expense]),
    FILTER(ALL('Calendar'),'Calendar'[Date]<=TODAY()&&'Calendar'[Date]>=DATE(YEAR(TODAY()),1,1)))

    Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

24 Replies