Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

YTD calculation on month data

How to calculate YTD data untill the latest full month. The data is on month base and not on date base

3 Replies

  • Anonymous 

    You try the 

    TOTALYTD(SUM('table'[value]), 'dates'[Date])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thnx Fowmy for the quick anwser.  For the Month I use a simple table and the problem is that this is not a date table but a text table. 

      test = TOTALYTD(CALCULATE('COF 2021'[COF % CY]), 'Calendar_final'[Month_name]) it is not giving an error but visual says it is not a type date

       

      • v-yalanwu-msft's avatar
        v-yalanwu-msft
        Community Support

        Hi, Anonymous ;

        If this is not a text type, you can try to use CONVERT() to convert the text type to a date type.such as:

        Column = CONVERT([Column1],DATETIME )

        If it doesn’t solve your problem, can you share pbix or screenshots whitout any sesentive information, and the results you want to output?