Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
2 ACCEPTED SOLUTIONS
v-yuta-msft
Community Support
Community Support

@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.

View solution in original post

@Anonymous,

 

Please sign in and click "Accept as Solution".

 

Capture.PNG 

 

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.

View solution in original post

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

@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
Not applicable

Hi there, 

 

That sorted what I wanted to achieve. 

 

Many thanks ! 

 

@Anonymous,

 

Great to hear that, could you please help mark the correct answer to finish the thread? Your contribution will be much appreciated.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi there, 

 

I do not see the option to mark as correct, can you please enlighten me? 

 

Thank you 

NM

@Anonymous,

 

Please sign in and click "Accept as Solution".

 

Capture.PNG 

 

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.

JoHo_BI
Responsive Resident
Responsive Resident

Hi Nelson, 

 

Are you trying to filter to multiple values? If so, you need to use the OR pipes. For example: 

 

VAR %EVO = CALCULATE(SUM('t_Detalhe_Processos_Fases_Tarefas'[Orcamento]);
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="CMP") ||
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXE") ||
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXC") ||
't_Detalhe_Processos_Fases_Tarefas'[Estado_Processo]="TM")
)
 
 
VAR SUM_INC = CALCULATE(SUM('t_Detalhe_Processos_Fases_Tarefas'[Incorridas_Totais]);
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="CMP") ||
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXE") ||
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]="EXC") ||
't_Detalhe_Processos_Fases_Tarefas'[Estado_Processo]="TM")
)
RETURN (SUM_ORCAMENTO-SUM_INC)/SUM_ORCAMENTO
 
Hope that helps!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.