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
Anonymous
Not applicable

Operaciones de comparación de DAX

Hola a todos

¿Puede alguien ayudar con el siguiente problema - Quiero que una tarjeta muestre 0 si se filtra otro objeto visual, de lo contrario mostrar el resultado del cálculo;

% de Satisfacción ( Satisfaction %)
if(isfiltered(SentimentScore[Sentiment])-"Negative",0,
CALCULATE(count('SentimentScore'[MessageID]),'SentimentScore'[Sentiment]<>"Negative")
/count('SentimentScore'[MessageID]))
Recibir el 'no admite la comparación de valores de tipo True/False con valores de tipo text.
Gracias
Rob
2 REPLIES 2
v-jingzhang
Community Support
Community Support

No @robcrockfordff7

Modifique su medida como se muestra a continuación. El valor devuelto de ISFILTERED() es True/False, que no se puede comparar con "Negative".

Satisfaction % =
IF (
    ISFILTERED ( 'SentimentScore'[Sentiment] )
        && SELECTEDVALUE ( 'SentimentScore'[Sentiment] ) = "Negative",
    0,
    CALCULATE (
        COUNT ( 'SentimentScore'[MessageID] ),
        'SentimentScore'[Sentiment] <> "Negative"
    )
        / COUNT ( 'SentimentScore'[MessageID] )
)

Por favor, hágamelo saber si esto ayuda.

Equipo de apoyo a la comunidad _ Jing Zhang
Si este post ayuda, considera Aceptarlo como la solución para ayudar a otros miembros a encontrarlo.

Pragati11
Super User
Super User

No @robcrockfordff7 ,

Vuelva a secuenciar su DAX con lo siguiente:

% de Satisfacción ( Satisfaction %)
if(isfiltered(SentimentScore[Sentiment])-"Negative",0,
CALCULATE(count('SentimentScore'[MessageID]), FILTER('SentimentScore', 'SentimentScore'[Sentiment]<>"Negative"))
/count('SentimentScore'[MessageID]))
Gracias
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.