Forum Discussion
Subtract values from same category but from different subcategories, show total on category level
We have to create two calculated column in Table1 (3)
1. To get value for type of subcategory.
Sub_Category_value = Calculated(Sum(KoersenTbl[Value]))
2. For this minus the sub_Category total from Category Total
Sub_Category_value_from_category_Total =
var Cur_category = 'Table1 (3)'[FundName]
var Cur_Sub_Category_value = Sub_Category_value
Return calculate ( sum(Sub_Category_value),filter ( all(Table1 (3)) ,'Table1 (3)'[FundName] =Cur_category ) ) -
Cur_Sub_Category_value
Try this, check the bold before execute. don't forgot it is calculated column in Table1 (3).
let me know any help
tried it and it shows a result, but not the expected one :) (even if I filter out dates), it still shows two rows.
- v-yulgu-msft9 years ago
Microsoft Employee
Hi JLdH,
Suppose the NAVTodaybis is a measure used to sum total values for each subcategary
NAVTodaybis = CALCULATE ( SUM ( KoersenTbl[Value] ), ALLEXCEPT ( 'Table1 (3)', 'Table1 (3)'[Title] ) )Based on that scenario, please create below measure and add it to matrix visual.
Subtract =
IF (
LASTNONBLANK ( 'Table1 (3)'[Title], 1 ) = "C+F",
BLANK (),
ABS (
[NAVTodaybis]
- (
CALCULATE (
SUM ( KoersenTbl[Value] ),
ALLEXCEPT ( 'Table1 (3)', 'Table1 (3)'[FundName] )
)
- CALCULATE (
SUM ( KoersenTbl[Value] ),
ALLEXCEPT ( 'Table1 (3)', 'Table1 (3)'[Title] )
)
)
)
)Output result.
Thanks,
Yuliana Gu