Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

MULTIPLE FILTERS NOT WORKING

Hi all, 

 

Can you please help me get the following expression working: 

 

 
VAR %EVO = CALCULATE(SUM('t_Detalhe_Processos_Fases_Tarefas'[Orcamento]);
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="CMP");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXE");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXC");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Estado_Processo]="TM")
)

VAR SUM_INC = CALCULATE(SUM('t_Detalhe_Processos_Fases_Tarefas'[Incorridas_Totais]);
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="CMP");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXE");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXC");
FILTER('t_Detalhe_Processos_Fases_Tarefas';'t_Detalhe_Processos_Fases_Tarefas'[Estado_Processo]="TM")
)
RETURN (SUM_ORCAMENTO-SUM_INC)/SUM_ORCAMENTO
 
The issue here is that the filters dont seem to work. What am I missing? 
 
Thank you all! 
N
  • Anonymous,

     

    Or you can modify your measure like below if you want to filter the rows which contains the assigned values.

    Result =
    VAR SUM_ORCAMENTO =
        CALCULATE (
            SUM ( 't_Detalhe_Processos_Fases_Tarefas'[Orcamento] );
            FILTER (
                't_Detalhe_Processos_Fases_Tarefas';
                't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]
                    IN { "CMP"; "EXE"; "EXC"; "TM" }
            )
        )
    VAR SUM_INC =
        CALCULATE (
            SUM ( 't_Detalhe_Processos_Fases_Tarefas'[Incorridas_Totais] );
            FILTER (
                't_Detalhe_Processos_Fases_Tarefas';
                't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]
                    IN { "CMP"; "EXE"; "EXC"; "TM" }
            )
        )
    RETURN
        ( SUM_ORCAMENTO - SUM_INC )
            / SUM_ORCAMENTO
    

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous,

     

    Please sign in and click "Accept as Solution".

     

     

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.