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
Giada_Togliatti
Post Patron
Post Patron

color de fondo condicional

Hola

Tengo un campo (texto de tipo de datos) llamado test que tiene algunas filas con Y y otras vacías

Necesito colorear las filas de una tabla con color amarillo si la prueba de campo es Y y blanco si está vacía.

No necesito mostrar la prueba de campo sobre la mesa.

¿Cómo puedo hacerlo?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Giada_Togliatti , puede crear una medida de color y utilizar una opción de campo después de seleccionar

Ejemplo

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

Hola @Giada_Togliatti

Puede crear una medida simple como se muestra a continuación:

Measure = IF(CALCULATE(MAX('Table'[test]))="Y",1,2)

A continuación, haga el formato condicional como se indica a continuación:

5.JPG

y para"No necesito mostrar la prueba de campo en la mesa."

será mejor que lo muestre (campo de prueba) en la tabla visual. si un valor tiene "Y" y está vacío juntos, ¿cómo se colorea?

por ejemplo:

6.JPG

En mi muestra simple, D tiene "Y" y está vacío en la prueba, si no arrastra la prueba en el objeto visual de la tabla.

Resultado:

7.JPG

y aquí está mi archivo pbix de muestra, por favor pruébelo.

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Giada_Togliatti , puede crear una medida de color y utilizar una opción de campo después de seleccionar

Ejemplo

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692

tex628
Community Champion
Community Champion

Cambie los valores de "Y / Blank" a "1 / 0" y luego aplique un formato condicional en cada columna que desee formatear.
Utilice el "basado en el campo" junto con el formato por reglas.

image.png
Br
J


Connect on LinkedIn

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.