Forum Discussion

HEW's avatar
HEW
Helper III
6 years ago
Solved

Bar chart - YTD figures

Hi.   We have a bar chart where we show YTD Current year, YTD last year and YTD budget figures.   However, for the actual YTD figures we would like only to show figures for the previous and curre...
  • amitchandak's avatar
    6 years ago

    HEW 

    First, you adjust the YTD to your financial year. Year from May -April will look like

    YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"))

    Also you can stop it max date of data
    YTD Sales =
    var _max = maxx(Sales,Sales[Sales date])
    return
    CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"),Sales[Sales date]<=_max)