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
okusai3000
Helper IV
Helper IV

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!

 

 

 

image.png

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@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]
)

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

@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]
)

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.