Average calculation for children in hierarchy
I want to create a bar char showing average number of cases per month for each year. For example:
139 reported cases YTD Dec. 2020 = 139 / 12 = 11,58 average cases per month
94 reported cases YTD Jun. 2021 = 94 / 6 = 15,67 average cases per month
I have used this formula in Targit: avg(d1, all(c), m1), which gives me the following result:

The caluclations are correct, but when i collapse the hierarchy (as i only want to report the yearly average) i get a math error:

How can i fix this? I am guessing i need to add some parameters to my formula? This is the desired result:







Comments
4 comments