Forum Discussion
Somar com filtro
- 3 years ago
Hi Anonymous ,
Based on your description, I have created a simple sample:
Please try:
Measure = IF(ISINSCOPE('Table'[ID]),SUM('Table'[Value]),CALCULATE(SUM('Table'[Value]),ALL('Table')))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 3 years ago
Hi Anonymous ,
Please try:
Measure = IF(ISINSCOPE('Table'[ID]),SUM('Table (2)'[Value]),SUMX(FILTER('Table (2)',RELATED('Table'[Column1])<>BLANK()),[Value]))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Caro Jianbo Li, muito obrigado pela resposta.
Utilizando seu exemplo, o output final que eu desejo é 190, e não 210.
Ou seja, a função deve reconhecer que não há valores na Column1 para o ID 2, e por isto não deve somar a coluna Value.
PS: Imagine que as colunas "Column1" e "Value" estão em tabelas/banco de dados distintos.
Muito obrigado novamente.