Forum Discussion
Subtract two columns
- 4 years ago
Hi, Anonymous
You can try the following methods.
Measure = SELECTEDVALUE(_GroupEarnings[_EarnAmount])-SELECTEDVALUE(_GroupDeductions[_DedAmount])Measure 2 = SUM(_GroupEarnings[_EarnAmount])-SUM(_GroupDeductions[_DedAmount])Both of these measures give the result of subtracting two columns.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more.
If the only connections are the year and payperiod (and presuming they will have same payperiod in both tables moving forward) you could try TREATAS:
Total =
VAR earnings =
MAX ( GroupEarnings[Earnings] )
VAR deductions =
MAX ( GroupDeductions[_DedAmount] )
RETURN
CALCULATE (
earnings - deductions,
TREATAS (
SELECTCOLUMNS (
GroupEarnings,
"Year", GroupEarnings[Year],
"Payperiod", GroupEarnings[Payperiod]
),
GroupDeductions[Year],
GroupEarnings[Payperiod]
)
)