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
Syndicate_Admin
Administrator
Administrator

La medida para el formato condicional funciona al 50%

Hola

Estoy intentando aplicar color de fondo en una matriz que contiene una columna "Distribución %":

td_beginner_0-1631675488666.png

Quiero realizar un cálculo y establecer el color bg ro rojo. La calcuación es:

% > (TMo Target + Over Varaince) O

% < (objetivo TMo + bajo varianza),

Establecer "Rojo"

Para esto escribí una medida (probando diferentes maneras):

Measure = 
/*
    SWITCH(
        TRUE(), 
        //([% of MB by Total MB all PMN] > SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Over Variance Numeric]) ), "Red"
        ([% of MB by Total MB all PMN] > SUMX(OutboundVolumes, OutboundVolumes[OverTargetValue] + 0 ) ), "Green",
        ([% of MB by Total MB all PMN] < SUMX(OutboundVolumes, OutboundVolumes[UnderTargetValue] + 0) ), "Red"
        //([% of MB by Total MB all PMN] < SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Under Variance Numeric]) ), "Red" 
        )
*/

    VAR distriPerc = VALUE('OutboundVolumes'[% of MB by Total MB all PMN])

RETURN
    IF ( distriPerc > (SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Over Variance Numeric]) ) ||
         distriPerc < (SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Under Variance Numeric]) ), 
            "Red" )

    /*    
    IF ([% of MB by Total MB all PMN] > SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Over Variance Numeric] ), 
        "Red", 
        IF ([% of MB by Total MB all PMN] < SUMX(OutboundVolumes, OutboundVolumes[Standard Target Display] + OutboundVolumes[Standard Under Variance Numeric]), 
            "Red", "Pink")
    ) 
    */
    //||
    //    ,))))

Con los resultados anteriores,

% Objetivo + Sobre Objetivo + Bajo

28 (5 + 10 = 15) ( 5 + -10 = -5) 28 > 15 - sin embargo, no se vuelve rojo.

72 (95 + 5 = 100) (95 + -1 = 85) 72 < 85 - Se vuelve rojo

El calc de varianza Target + Over de alguna manera no funciona.

Los datos de los resultados anteriores se ven como los siguientes (todos los campos son de tipo %)

td_beginner_1-1631676096235.png

Los valores del campo Sobre varianza son:

td_beginner_2-1631676268918.png

Necesito ayuda para averiguar por qué el calc Target + Over no funciona. Cualquier ayuda es apreciada.

Gracias

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@td_beginner , Pruebe una medida como esta y úselo en formato condicional usando la opción de valor de campo

If( [Distribución %] >[Tmo Target] + [Sobre Varianza] , "Rojo", "Blanco")

Gracias por su respuesta @amitchandak

Escribí una medida como usted dijo:

OnlyOver_Measure = IF ([% of MB by Total MB all PMN] > SUMX(OutboundVolumes, [Standard Target Display] + [Standard Over Variance Numeric]) , "Red", "Green"  )

Y el resultado es que el % de distribución se muestra como verde en lugar de rojo.

td_beginner_0-1631743016711.png

Los cols % de distribución y objetivo de TMo en la matriz son medidas que devuelven valores de % y texto respectivamente. Los cols Over Variance & Under Variance contienen valores de campos de tipo Text- los datos originales.

Para trabajar en las calcuaciones, he duplicado los campos y hecho de tipo %.

Para depurar el problema anterior, agregué esos campos de % creados en Matrix, y veo valores diferentes a los que hay en los datos, se muestran como Suma y no solo como valor.

¿Podría ser este el problema ??? Pero entonces, ¿cómo es que el col bajo Varianza % está funcionando perfectamente bien?

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.