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
Thimios
Helper II
Helper II

Medidas en matriz con formato condicional

Hola a todos

Tengo la siguiente matriz con un par de medidas. Necesito formatear condicionalmente el fondo para cada fila de la medida % FOOD COST. Las capacidades existentes permiten el formato condicional de la medida sin tener en cuenta la línea.

2020-06-23 15_02_03-SDv2 - Power BI Desktop.png

¿Alguna idea?

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hola @Thimios ,

¿Quieres obtener el siguiente resultado?

3-1.PNG

Aquí está la medida:

Measure =
SWITCH (
    SELECTEDVALUE ( TestTable[Name] ),
    "A", "red",
    "B", "yellow",
    "C", "green",
    "D", "gray"
)

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft Me temo que no. Este es el escenario:

2020-06-24 09_22_17-Book1 - Excel.png

Hola @Thimios ,

Puede consultar la siguiente medida:

Measure =
VAR a =
    SELECTEDVALUE ( Table[CATEGORY] )
VAR b =
    SELECTEDVALUE ( Table[%FOOD COST] )
VAR if1 = ( a = "BURGER"
    && b < 0.42 )
    || ( a = "CLUB"
    && b < 0.55 )
    || ( a = "HOTDOG"
    && b < 0.4 )
    || ( a = "PIZZA"
    && b < 0.4 )
VAR if2 = ( a = "BURGER"
    && b >= 0.42
    && b <= 0.44 )
    || ( a = "CLUB"
    && b >= 0.55
    && b <= 0.57 )
    || ( a = "HOTDOG"
    && b >= 0.4
    && b <= 0.42 )
    || ( a = "PIZZA"
    && b >= 0.4
    && B <= 0.42 )
RETURN
    IF ( if1, "green", IF ( if2, "yellow", "red" ) )

A continuación, ponga esta medida en formato condicional.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft Funciona como un encanto, gracias!

Es genial entender la lógica detrás de eso y todas las aplicaciones posibles.

@amitchandak Para ponerlo en términos de su publicación, Ingresos debe ser formateado por Cliente. En mi caso, Revenue necesita tener un formato de color diferente para cada cliente.

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.