Forum Discussion
Handle AverageX on different granularities matrix drilldown
- 10 months ago
Hello,
The question has not been resolved but I have found a workaround using bookmarks and seperate measures for each level of hierarchy. I guess the problem lies in the hierarchy context for the totals for which a single measure is "impossible" to use.
Kind regardsKevin
Hello,
I made an example to make it more clear what I want because I don't know how to solve it with your reply.
This is my example with the same formula I used. These are 3 dimensions linked to a fact (not following correct naming and best practices but it still works).
On regional level the grand total should be 25 as => (28 jan + 22 feb) / 2 = 25
On sales person level the grand total is correct which is 6.5 but the subtotal per month is not correct and should be 7 for january and 6 for febuary which makes 6.5 for the grand total.
_DynamicMeasureAccuracy2 =
VAR values_columns =
VALUES ( 'Date'[Month] )
RETURN
SWITCH (
TRUE (),
ISINSCOPE ( 'Date'[Month] ), [SumValue],
ISINSCOPE ( Region[Region] ), AVERAGEX ( values_columns, [SumValue] ),
ISINSCOPE ( SalesPerson[SalesPerson]),
AVERAGEX (
CROSSJOIN ( VALUES ( Region[Region] ), values_columns ),
[SumValue]
),
AVERAGEX (
CROSSJOIN ( VALUES ( SalesPerson[SalesPerson] ), values_columns ),
[SumValue]
)
)
Thanks
Kind regards
Kevin
It appears that you have two fact tables (Actual, Forecast). Please note your _DivideAccuracy creates rows averages with no salesperson. I am not sure what you are trying to do there. Are you trying to filter out rows where you do not have both forecast and actuals for the given date? In any case try this measure: