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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
delfina04
Frequent Visitor

condicional con varios registros

como agregar una medida que me identifique si un cliente fue contactado por el vendedor y si le paso el mensaje correcto en base a un plan de acción. (puede haber vendedores que contactaron varias veces al cliente y le pasaron varios mensajes) lo que se busca medir es cual de esos mensajes corresponde efectivamente al plan bajado por la compañia. 

Ya cuento con una columna condicional que me dice si el mensaje que se envio corresponde o no al mensaje clave.

Lo que busco ahora es tener una columna que me diga cuantas veces fue contactado el cliente y si en alguna de esas se le paso el mensaje clave pactado. 

Por ejemplo, el cliente 17693 fue contactado por el vendedor 2 veces,pasandole 2 mensajes distintos pero solo el mensaje de la primer visita es correcto y debería contar como que cumplio la estrategía compañia, mientras que el segundo mensaje sería contado como adicional.

delfina04_0-1722340503639.png

muchas gracias!

1 ACCEPTED SOLUTION
BeaBF
Super User
Super User

@delfina04 Hi!

Assuming you already have a column named IsCorrectMessage which contains TRUE if the message is correct and FALSE otherwise.

 

Create a new column to count the number of times each customer was contacted:

ContactCount =
CALCULATE(
COUNT(TableName[ContactID]),
ALLEXCEPT(TableName, TableName[ClienteID])
)

 

Create a measure to check if the correct message was sent at least once:

CorrectMessageSent =
CALCULATE(
COUNTROWS(TableName),
TableName[IsCorrectMessage] = TRUE()
)

 

Now, create a final measure to check if the customer was contacted according to the plan:

PlanCompliance =
IF(
[CorrectMessageSent] > 0,
"Compliant",
"Non-Compliant"
)

 

This measure will return "Compliant" if the correct message was sent at least once, otherwise it will return "Non-Compliant".

 

BBF

View solution in original post

1 REPLY 1
BeaBF
Super User
Super User

@delfina04 Hi!

Assuming you already have a column named IsCorrectMessage which contains TRUE if the message is correct and FALSE otherwise.

 

Create a new column to count the number of times each customer was contacted:

ContactCount =
CALCULATE(
COUNT(TableName[ContactID]),
ALLEXCEPT(TableName, TableName[ClienteID])
)

 

Create a measure to check if the correct message was sent at least once:

CorrectMessageSent =
CALCULATE(
COUNTROWS(TableName),
TableName[IsCorrectMessage] = TRUE()
)

 

Now, create a final measure to check if the customer was contacted according to the plan:

PlanCompliance =
IF(
[CorrectMessageSent] > 0,
"Compliant",
"Non-Compliant"
)

 

This measure will return "Compliant" if the correct message was sent at least once, otherwise it will return "Non-Compliant".

 

BBF

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.