Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

TotalYTD until when?

Hi guys, i have a Table with actual and forecast values. So the dates in the table range up to end of 2020 due to the forecast values. 

 

So i want to calculate sum of values until today with totalytd. 

 

But im unsure if totalytd would use today as the ytd date or the last date in the table which would be end of 2020?

 

Thx guys

  • Anonymous assuming you have date dimension in your model

     

    As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

    https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

     

    Add following measure

     

    Forecast = 
    CALCULATE ( SUM ( Table[Forecast] ), DATESYTD ( DateTable[Date] ), DateTable[Date] <= TODAY() )

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

1 Reply

  • Anonymous assuming you have date dimension in your model

     

    As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

    https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

     

    Add following measure

     

    Forecast = 
    CALCULATE ( SUM ( Table[Forecast] ), DATESYTD ( DateTable[Date] ), DateTable[Date] <= TODAY() )

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.