Forum Discussion

auxilio99357's avatar
auxilio99357
Frequent Visitor
5 years ago
Solved

Time - intelligence: YTD/ LYTD

Hii! I´m a begginer with PowerBI and have some problems with the time-intelligence functions im using.   I have two tables, the first one is a sales table with the following columns: client/date/u...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    5 years ago

    Hi, auxilio99357 

     

    Yes, if you use time intelligence functions, such as TOTALYTD, then you need to select a specific date, such as 2020. If the context does not have a specific year,it will select the date with the largest date, so an error occurs.

    In a line chart with a year, the time intelligence function should be no problem, but if it used in the table, you need to rewrite the measure and specify a specific year.

    Like:

    2020YTD =
    CALCULATE ( SUM ( Sales[Units] ), YEAR ( DimDates[Date] ) = 2020 )

    If you only put the month on the slicer, it will include all the corresponding months of the year, then there will be loopholes in the logic you said. Please try to understand what I said and make changes.

     

    Best Regards

    Janey Guo

     

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