Forum Discussion
Measure totals problem with specific row exclusions
Hi there,
I have a complicated problem with measure totals in a hierarchical row context.
Problem:
I have two measures (say for sake of example VAL_ONE and VAL_TWO)
I built a view that displays VAL_ONE for accounts that report VAL_ONE, and VAL_TWO for all others
Accounts are grouped into regions and the row totals for regions works how I would hope using this implementation:
See also attached PBIX
Desired output:
Does anyone know of an alternate approach to work for this case? Maybe I'm missing something obvious
- Anonymous2 years ago
Hi champioz ,
I interpreted your problem description and made the following attempts:
Firstly, change the original measure to:
Combo Measure that Favors VAL_ONE, Excludes Acc One = VAR _past_reported_val = CALCULATE ( [VAL_ONE_TOTAL], ALL ( Dates ) ) RETURN IF ( HASONEFILTER ( 'Accounts'[Name] ), IF ( AND ( ISBLANK ( [VAL_ONE_TOTAL] ), _past_reported_val = 0 ), [VAL_TWO_TOTAL], [VAL_ONE_TOTAL] ) )Then create a new measure and achieve your requirements:
MEASURE = IF ( HASONEFILTER ( Accounts[Name] ), 'VAL_ONE'[Combo Measure that Favors VAL_ONE, Excludes Acc One], SUMX ( ALLEXCEPT ( 'Accounts', Accounts[Region] ), [Combo Measure that Favors VAL_ONE, Excludes Acc One] ) )Finally, you can get the correct result at the row level:
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
1 Reply
- AnonymousNot applicable
Hi champioz ,
I interpreted your problem description and made the following attempts:
Firstly, change the original measure to:
Combo Measure that Favors VAL_ONE, Excludes Acc One = VAR _past_reported_val = CALCULATE ( [VAL_ONE_TOTAL], ALL ( Dates ) ) RETURN IF ( HASONEFILTER ( 'Accounts'[Name] ), IF ( AND ( ISBLANK ( [VAL_ONE_TOTAL] ), _past_reported_val = 0 ), [VAL_TWO_TOTAL], [VAL_ONE_TOTAL] ) )Then create a new measure and achieve your requirements:
MEASURE = IF ( HASONEFILTER ( Accounts[Name] ), 'VAL_ONE'[Combo Measure that Favors VAL_ONE, Excludes Acc One], SUMX ( ALLEXCEPT ( 'Accounts', Accounts[Region] ), [Combo Measure that Favors VAL_ONE, Excludes Acc One] ) )Finally, you can get the correct result at the row level:
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!