Forum Discussion

dwel0120's avatar
dwel0120
Icon for Helper III rankHelper III
4 years ago
Solved

Bar chart - YoY comparison - Future Dates

Hello - I have a line/bar graph that tracks a number of people (Light blue line - previous year and dark blue line is the current year). The bars represent the YoY change. How do I write the formula for the YoY change so the future dates or blank or don't show up yet until the Current Year has data? So from 9/4/2022 through 12/2/22 it wouldn't show the bars since there is no current year data yet. 

 

Current Measures:
WklyCY = 

calculate(
        sum(Table1[USERS]),
        Table1[SCHOOLYEAR] = "SY22-23"
)

 

WklyPY =
    calculate(
        sum(Table1[USERS]),
        Table1[SCHOOLYEAR] = "SY21-22"
)

 

WklyYoYChange =
[WklyCY]-[WklyPY]

 

  • will it work if you put it as a filter in your calculate statments for current year and YOY?

4 Replies

  • Create a calculated column based on your date column:
    Future Date = IF(Date > Today(), "Y","N")
    Then filter your visual based on that column so that Future Date = N

    • dwel0120's avatar
      dwel0120
      Icon for Helper III rankHelper III

      claymcooper That doesn't work because I still need it to show the PY line (the light blue line in my original post).

       
      • claymcooper's avatar
        claymcooper
        Icon for Resolver II rankResolver II

        will it work if you put it as a filter in your calculate statments for current year and YOY?