Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dwel0120
Helper III
Helper III

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]

dwel0120_0-1661798701932.png

 

1 ACCEPTED SOLUTION

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

View solution in original post

4 REPLIES 4
claymcooper
Resolver II
Resolver II

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

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

 

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

@claymcooper  YES!! That totally worked. 

dwel0120_0-1661804648716.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.