Forum Discussion
Optimize DAX Filter
- 3 years ago
If there is no misunderstanding, this shall work:
SomaDespesasValorNominal =
CALCULATE(
SUM('BI-Financeiro-Despesas'[ValorNominal]),
USERELATIONSHIP('BI-Financeiro-Despesas'[DataEmissao], Calendario[Date]),
FILTER (
'BI-Financeiro-Despesas',
('BI-Financeiro-Despesas'[Documento] <> "CH PRE DATADO"
&& NOT 'BI-Financeiro-Despesas'[CodBanco] IN { "80018", "76", "98", "107", "991", "995", "996", "997", "998", "999"}
)
)
)You can also maintain a table for the values you want to filter out. It would be even better.
If there is no misunderstanding, this shall work:
SomaDespesasValorNominal =
CALCULATE(
SUM('BI-Financeiro-Despesas'[ValorNominal]),
USERELATIONSHIP('BI-Financeiro-Despesas'[DataEmissao], Calendario[Date]),
FILTER (
'BI-Financeiro-Despesas',
('BI-Financeiro-Despesas'[Documento] <> "CH PRE DATADO"
&& NOT 'BI-Financeiro-Despesas'[CodBanco] IN { "80018", "76", "98", "107", "991", "995", "996", "997", "998", "999"}
)
)
)
You can also maintain a table for the values you want to filter out. It would be even better.
- Aucesar3 years agoHelper III
Hi Thanks,
The suggestion to create a table with filters is good, and using NOT and IN is the solution.