Forum Discussion

kasife's avatar
kasife
Icon for Helper V rankHelper V
2 years ago
Solved

Filter by project and date

Hi, guys

 

I have a difficulty, I created the following measure to dilute my goal into days in my calendar table:

 

Meta Diluida = 

VAR MesAno = MONTH(d_calendario[Date])&YEAR(d_calendario[Date])
VAR ProjetoSelecionado = SELECTEDVALUE(projetosReaal[Nome do Projeto Original])

RETURN



IF(
    d_calendario[Dias de trabalho]=1,
        DIVIDE(
            CALCULATE(
                SUM(MetaUH[Meta Desafio]), 
                    FILTER(
                        MetaUH, 
                        MetaUH[Mes ano formula padrão] = MesAno || MetaUH[Mes ano formula padrão] = ProjetoSelecionado
                        )
                ), 
                [Dias uteis Mês])
                )

 

 

And then I added it up and I'm using it in my visuals

 

Total Meta Diluida = 
VAR ProjetoSelecionado = SELECTEDVALUE(MetaUH[Projeto])

RETURN

CALCULATE(
    SUM(d_calendario[Meta Diluida]),
    FILTER(
        projetosReaal, 
        projetosReaal[Nome do Projeto Original] = ProjetoSelecionado
    )
)

 

When I do the filter by selecting date, it works, but when I select the project, the measurement remains static. How could I adjust this?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi kasife,

    I can't access the share link, can you please paste some dummy data here with table format? We can directly copy and enter them into power bi to test coding formula.

    How to Get Your Question Answered Quickly  

    In addition, you can also try to use the following measure formula if helps:

    Total Meta Diluida =
    CALCULATE (
        SUM ( d_calendario[Meta Diluida] ),
        FILTER (
            ALLSELECTED ( projetosReaal ),
            projetosReaal[Nome do Projeto Original] IN VALUES ( MetaUH[Projeto] )
        )
    )

    Regards,

    Xiaoxin Sheng

4 Replies