I have a line chart that shows sales data by fiscal week and I want to be able to display only up through the selected fiscal week. There is a parameter [fiscal week selection] that allows viewers to input what fiscal week they want to see metrics on and I want this to be the end of the range of data in my line chart. So I need a calculation that filters the line chart to show a line from fiscal week 1 through to [fiscal week selection]. I can do this range using a number with this calculation:
[Sum of Opps (All opps)],
( 'CALENDAR' ),
> 0 && 'CALENDAR'[Fiscal Week] <= 20
), 'CALENDAR'[Fiscal Year]=2019
but when I try to put [fiscal week selection] in place of 20, it does not display the data correctly. I do not want to add a slicer to filter my chart as this adds yet another element viewers have to change/input. I want them to be able to choose a fiscal week and see the metrics for that week as well as have the chart change to display only up through the selected week.
@Anonymous - I'm not sure what else to try, except some troubleshooting steps. Your original measure works with a hard-coded max week. The measure with a variable based on MAX(Parameter[Fiscal Week]) is not working, so then I'd test the value for MAX(Parameter[Fiscal Week]) in a separate measure. If that is giving the proper value, then the only way for the measure with variable to be wrong is for relationships to be messing it up somehow. But, to troubleshoot, I'd need the pbix.