Forum Discussion

DieLem's avatar
DieLem
Icon for Helper II rankHelper II
8 years ago
Solved

DatesYTD returns Blank

I have a simple DATESYTD function:

CS Total = CALCULATE(sum(FinanceLog[Value]), FinanceLog[Segment0Code_1] = "CS")

CS YTD = CALCULATE([CS Total], DATESYTD('Date'[Date].[Date]))

That returns a blank. The PBI file ("FinanceTest") can be found here:

https://drive.google.com/drive/u/1/folders/1P10op_192ac_m-QGqt-QjolaLZSIMc_t

Why is it returning blank? What can I do to fix it?
Thanks in advance!

  • DieLem's avatar
    DieLem
    8 years ago

    Hey Anonymous,

    Thanks for the feedback the table does help to visualise it better.

    What I still don't understand, regarding the Year/YearMonth table, the YTD values start adding from Apr-2017. Should the DATESYTD function not only give YTD from January until 'today'? Or only 12 months. This gives YTD values for 24 months?

    Secondly, I have added the "CS Total" to your table. YTD should be Cumulative of the CS Total, yet I don't see a correlation?

    Thanks!

  • Anonymous's avatar
    Anonymous
    8 years ago

    DieLem,

    2017 has value from Jan to Dec, please check the calculations below.



    Regards,
    Lydia

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    More than likely, change your measure to this:

     

    CS YTD = CALCULATE([CS Total], DATESYTD('Date'[Date]))

    I am guessing that you have this in a visual that has like month or something and so you need to pass the full Date column into the function versus the .[Date] component of that column. The time intelligencquick measures are all messed up because of this kind of thing.

     

    • DieLem's avatar
      DieLem
      Icon for Helper II rankHelper II

      Hi Greg_Deckler thanks for the response.

      You're solution still returns a blank. The only time I get some value back is when I change the "last date" in my date dimension table to 31/12/2018. Surely I am doing something wrong, YTD calculations shouldn't be managed by changing your Date Dimension table?

       

      Thanks!