Forum Discussion

Tomast's avatar
Tomast
New Member
3 years ago
Solved

Problem with YDT calculation, values are BLANK after calendar table was updated to include year 2023

Hello,

 

I updated the calendar table to include 2023 year. Now we are in 27/10/2023, And all the YTD calculations are showing BLANK. 

 

the link in the joins is fine, I tested going back with the calendar ending in 31/12/2022 and the calculation of YTD were fine again.

 

I'm using the quick meassure from Power BI:

 

Revenues YTD =
IF(
    ISFILTERED('Calendario'[Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    TOTALYTD([Revenues IW], 'Calendario'[Date].[Date])
)
  • Hello Comunity!

     

    I've solved the problem, instead of using TotalYTD I've used calculate and filter the current year:

     

    Revenues YTD LT =
    CALCULATE(SUM('Ratios LT '[Revenues]),'Calendario'[Year]=year(today()))
     
    Thanks for all the help!

11 Replies

  • Tomast . do not use .date. Mark Calendar tbale as Date table

     

    TOTALYTD([Revenues IW], 'Calendario'[Date])

     

    Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
    https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

     

     

    • Tomast's avatar
      Tomast
      New Member

      I've tried all the sugested points in your video and also taking out the .date and changing the calendar as date table and nothing worked

  • I marked my calendar table as date table and also took out the ".date" part of the formula but still appears as blank

    • pbi-novice's avatar
      pbi-novice
      Icon for Helper I rankHelper I

      Try adding a filter to the TOTALYTD function:

       

       

      Revenues YTD =
      IF(
          ISFILTERED('Calendario'[Date]),
          ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
          TOTALYTD([Revenues IW]'Calendario'[Date].[Date], YearColumn = YEAR(TODAY))
      )
      • Tomast's avatar
        Tomast
        New Member

        I've tried that too but is still blank. The only solution I found is to go back and use as last that of the calendar 31/12/2022. Otherwise appear the blank. But I need to add 2023 forecast

  • What also worked is to add an slicer with the date and select the current Year

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Tomast ;

    What you mean is to display blank after selecting 2023, and it is normal before selecting 2023; Can you take a screenshot to look at your data (remove sensitive information), from the formula, your dax is correct, since your date in 2023 is indeed updated, but you need to ensure that there is [Revenues IW] in 2023, if this number is not, then naturally it is also null.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hello Comunity!

     

    I've solved the problem, instead of using TotalYTD I've used calculate and filter the current year:

     

    Revenues YTD LT =
    CALCULATE(SUM('Ratios LT '[Revenues]),'Calendario'[Year]=year(today()))
     
    Thanks for all the help!