Forum Discussion
Filter for Chart Based on Filter for Page
- 2 years ago
Hi pooofy,
I create some dummy data for demo as attached: Exercise File
Please create below measure for your chart and replace the [*Measure*] to your own
Gauge Chart Value = var maxyear = MAXX('Table', 'Table'[Date].[Year]) var minyear = maxyear -2 var result = CALCULATE([*Measure*], FILTER( ALL('Table'), 'Table'[Date].[Year] <= maxyear && 'Table'[Date].[Year] >= minyear)) return resultFeel free to let me know if any questions, thanks!
- 2 years ago
Hi pooofy,
Please try below measure in your column chart:
Column Chart Value = var maxyear = MAXX(ALLSELECTED('Table'), 'Table'[Date].[Year]) var minyear = maxyear -2 var selectedyear = SELECTEDVALUE('Table'[Date].[Year]) var result = IF( selectedyear <= maxyear && selectedyear >= minyear, CALCULATE([Measure], ALL('Table'[Date]), 'Table'[Date].[Year] = selectedyear), BLANK()) return result - 2 years ago
Hi pooofy ,
You can add constant line in the Analytics Pane, and put your [Measure] in the fx. Thanks.
Hi isjoycewang ,
I tried to insert a line, but unfortunately, my chart does not show an option for "Constant Line", it only has Trend line and X-Axis Constant Line.
Do you know if there is another way to add a Y-Axis Constant line?
I am using the Line and Column chart. There is a field for Lin y-axis. However, if I insert my measure into that field, the result shows the average, taking the year in the chart as the max year, e.g. for 2021, the average is calculated with 2021 as the max year, instead of the max year of the entire page.
Is there an alternative way to create a constant y-line based on the average with the max year as the last year for the chart?
Thank you!
Hi pooofy ,
I'm not sure why there's no constant line in your visual, are you using the column chart?
It looks the constant line cannot apply in the "Line and Column Combined Chart". Thanks!
- pooofy2 years agoHelper I
Thank you!
I have other lines in the chart, e.g. sum of total, average across categories. These are not constant lines. Is there any way to add these lines into a Column chart?
Thank you!