Forum Discussion
Filter Removal - DAX
If you want to calculate the result as Income - Expense while ignoring external filters on Expense and Income, you can use the following DAX formula:
Result =
CALCULATE(
SUM('YourTable'[Income]) - SUM('YourTable'[Expense]),
ALLEXCEPT('YourTable', 'YourTable'[Result])
)
In this formula, replace 'YourTable' with the actual name of your table that contains the Income, Expense, and Result columns.
The SUM('YourTable'[Income]) - SUM('YourTable'[Expense]) calculates the difference between the total income and total expense.
The ALLEXCEPT('YourTable', 'YourTable'[Result]) removes all the filters applied to the table, except for the Result column, ensuring that the calculation is performed independently of any filters on the Expense and Income columns.
This way, the calculated result will not be influenced by external filters on Expense and Income, and it will provide the desired outcome of Income - Expense.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
- Anonymous3 years agoNot applicable
I can't do it this way because my data structure is as per the image below
Amount Column, another expense and income column and etc.