My data has fields Year (2016,2017,2018) and ID. I want to create a bar chart with dimension: Year, measure: COUNT(ID). The thing is, I want the accumulated result. For example, if I select Year=2016, it will show me count of ID in 2016; if I select Year=2017, it will show me count of ID in 2016 & 2017, and so on.
Since I am ignoring the selection of Year in the main expression... it will not filter down to just the required year and will show all the years. Avg(1) is used to remove all the unselected year. Avg(1) = 1 for selected year and equals 0 for unselected years