Forum Discussion
DenisBerisha
3 years agoNew Member
Calculate and filter
Hi, Im trying to use the following DAX functions but I get an error. Expenses = Calculate ( [Transaction Amount], FILTER ( transactions[Type] = "debit" ), transaction...
joaoribeiro
Impactful Individual
3 years agoHello,
In order to use the FILTER function you must add the table which you want to filter as first argument, as shown below. Please notice that, for boolean filters (filters which the result is not a table), it's more performanic to not use the FILTER function and use the filter directly in the CALCULATE function, as you did for the other filters.
Sintax:
FILTER(<table>,<filter>)
Example:
Expenses =
Calculate (
[Transaction Amount],
FILTER ( transactions, transactions[Type] = "debit" ),
transactions[Category] <> "transfer",
transactions[Category] <> "Credit Card Payment"
)
Please find more details in the following link:
https://learn.microsoft.com/en-us/dax/filter-function-dax
Hope it helps!
Regards,
Joao