Forum Discussion

okusai3000's avatar
okusai3000
Icon for Helper IV rankHelper IV
4 years ago
Solved

Count only when 2 columns are different

Hi everyone,

 

I'm trying to count some values, only when the column "Fecha Inicio tratamiento" and "Fecha Fin tratamiento MOD" are differents.

I tried things as:

 

calculate(COUNT('fact Prescripciones'[Id Tratamiento]),
FILTER(all('fact Prescripciones'[Fecha Inicio Tratamiento]),'fact Prescripciones'[Fecha Inicio Tratamiento] <> SELECTEDVALUE('fact Prescripciones'[Fecha Fin Tratamiento MOD]))
 
but it's not working. Any idea?

thanks!

 

 

 

 

  • okusai3000 

    I think this gives me what you are looking for.

    The Measure = 
    CALCULATE (
        COUNT( 'fact Prescripciones'[Id Tratamiento] ),
        'fact Prescripciones'[Fecha Inicio Tratamiento] <> 'fact Prescripciones'[Fecha Fin Tratamiento MOD]
    )

1 Reply

  • okusai3000 

    I think this gives me what you are looking for.

    The Measure = 
    CALCULATE (
        COUNT( 'fact Prescripciones'[Id Tratamiento] ),
        'fact Prescripciones'[Fecha Inicio Tratamiento] <> 'fact Prescripciones'[Fecha Fin Tratamiento MOD]
    )