Forum Discussion

BLM's avatar
BLM
Helper I
8 years ago
Solved

Filter context

hi!!

I have many problems with the filters in Dax, I woul like found some tutorial about It....

I want a Measure, "Numero de Cargas", affected by the slicers "año" y "mes" but Not by "1R-Cargado Por". 

This is the formula:

 

NumCargas = CALCULATE(DISTINCTCOUNT(Cargas[carID]);ALLSELECTED(Cargas[1R-Cargado Por]))

 

but don't work.

 

I attache a image

Too, I have created a column, :

 

Column = CALCULATE(DISTINCTCOUNT(Cargas[carID]);ALLEXCEPT(Cargas;Cargas[1R-Cargado Por]))

but the result it worst...

Help me, please

  • Hi BLM,

     

    You need to clean the filter in the formula by "ALL", "Allexcept" etc. It could be like this:

    NumCargas =
    CALCULATE (
        DISTINCTCOUNT ( Cargas[carID] );
        ALL ( Cargas[1R-Cargado Por] )
    )

    If this doesn't work, please provide your data model. A dummy one is enough.

     

    Best Regards,

    Dale

1 Reply

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi BLM,

     

    You need to clean the filter in the formula by "ALL", "Allexcept" etc. It could be like this:

    NumCargas =
    CALCULATE (
        DISTINCTCOUNT ( Cargas[carID] );
        ALL ( Cargas[1R-Cargado Por] )
    )

    If this doesn't work, please provide your data model. A dummy one is enough.

     

    Best Regards,

    Dale