It will not be easy to help you as we need more information, but at least I can help you clarify the problem you're facing. Measure are calculated as they're displayed with the filter context provided by the visual.
Which means that the total of your table is the calculation of your measures without the filter you have on your lines (can't tell you which one since the column is hidden on your screeshot).
And that's what explain the incorrect total.
Different solutions exists to control that :
1/ Use X functions like SUMX to keep the calculation row by row (using SUM will aggregate values).
2/ SUMX will need a table as first argument, you can use ALLSELECTED or FILTER to create that table based on the lines of your table.
3/Compute the difference.
Hope it helps otherwise do not hesitate to provide dummy datas.