Forum Discussion
Need help with substraction within a column
- 6 years ago
A simple way would be following measure:
Measure = CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Return" ) -
CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan" )If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
- 6 years ago
vik0810 wrote:A simple way would be following measure:
Measure = CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Return" ) -
CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan" )If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
Awesome! I only needed to make minor adjustment (instead of SUM, I used Count) and it works. Thank you!
Regards
E
I'm not sure I understand correctly. Is this what you're looking to do?
If you want to count the number of records of Type Loan and subtract the number of records of Type Return, you would create a column like this. A row with Loan gets a value of 1, a row with a Return gets a value of -1, everything else has 0 impact.
YourColumnName = if([operation_type_desc (groups)] = "Loan";1;if([operation_type_desc (groups)]= "Return";-1;0))
You can now use this column to display the value of (number of Loans -/- number of Returns)