You can use below custom expression for heirarchy say you have [Year] NEST [Region] in your bar chart X-Axis and want to calculate cumulative rowcount for each region per year in Y-Axis:

`Count() OVER (Intersect(NavigatePeriod([Axis.X],"Year",-1,0),[Region])) + Count()`

where NavigatePeriod will help to bring values from previous year for each Region and add it up with current year value using count()

Same can be achieved in calculated column:

`Count() OVER (Intersect(Previous([Year]),[Region])) + Count() OVER ([Year],[Region])`

Note: Over calculations done in calculated columns are not affected by filters. If you would like your bar chart to update values as per filter selection, use custom expressions in visualizations.

## 1 Comment

The custom expression would be different for a calculated column and an axis column. But you can start with the Interset() function.

For a calculated column, use:

For a bar chart, if the x-axis is e.g.:

then for the y-axis, use: