Forum Discussion

dbensley's avatar
dbensley
Frequent Visitor
9 years ago

Having trouble making a YTD Graph look right

New to PowerBI and I am having trouble making a graph look right. This is year of year sales and I am having trouble getting the current year to look right compared to the previous. You can see on the graph below that for the current year, my data only goes through September while the previous years are all complete. I want the current year to stop rather than show a trailing straight line. It looks misleading the way this is drawn.

 

 

5 Replies

    • dbensley's avatar
      dbensley
      Frequent Visitor

      Sean, Thanks for the tips, but that didn't really get me what I am looking for. The resulting chart is giving me Cumulative YTD year of year, so after year 1, year 2 starts off where year 1 left off. If you see the graph above, it is exactly what I am looking for (Each year starts at 0 and goes up from there to give me a year over year comparrison. All I really want to do is have the current year (2017) line stop at the current month rather than show a straighy line for the remaining year. It just looks misleading and causes the user to have to think about where we are in the year vs. having the graph illustrate it. Any other thoughts are appreciated.

       

      Thanks,

      Danny

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

        Do you have a Calendar Table?

        From your picture it looks like you have a Line Chart with these fields

        Axis - Month (from a Calendar table ? )

        Legend - Year (from a Calendar table ? )

        Values - Some Measure

         

        Try plotting a Measure that uses either TOTALYTD or DATESYTD

         

        YTD Measure FY 06-30 =
        TOTALYTD ( SUM ( Table[Column] ), 'Calendar'[Date], "06/30" )
        
        YTD Measure FY 06-30 ALT =
        CALCULATE ( SUM ( Table[Column] ), DATESYTD ( 'Calendar'[Date], "06-30" ) )

        The Fiscal Year Ending part in red is optional!

         

        This works for me!

        Good Luck!:smileyhappy:

         

         

  • Use TOTALYTD function and insert the filtered date series into the Dates variable. For example:

    column YTD = TOTALYTD(
    SUM(dataset[column]),
    FILTER(ALL(dataset[date].[Date]),dataset[date].[Date]<=MAX(dataset[date])
    ))