Forum Discussion

stuckymcstuck's avatar
stuckymcstuck
Frequent Visitor
3 years ago

Filter specific line in line graph based on month

Hello, 

 

I'm using a line graph on a summary page with 3 lines:

 

1 - Forecasted %

2 - Total % of resource

3 - Actual % of time (based off timesheet data)

 

I have the data from April 2023 - March 2024 for lines 1 & 2 but only have April 2023 for line number 3 and this will be calcuated and added to the graph as the months progress. However, the line for number 3 is showing through will March 2024 with April 2023 figure, but I only want to show it for the specific month. How do I fix this?

 

Thanks 

1 Reply

  • You need to detect the last date ever in the timesheet data and only return a result if the reference date is before that, something like

    My Measure =
    VAR ReferenceDate = MAX('Date'[Date])
    VAR LastTimesheet = CALCULATE(MAX('Timesheet'[Date]), REMOVEFILTERS())
    RETURN IF( ReferenceDate <= LastTimesheet, do calculation here )