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

color de fondo de la tarjeta / botón visual

Hola

No estoy llegando a corregir el alma para cambiar el color de fondo de visual basado en la siguiente condición:

"En la tarjeta visual necesita mostrar el color de fondo basado en el valor"Error" en la última hora. si el valor del error es "Verdadero" en la última hora, entonces debe mostrar el color rojo de lo contrario debe mostrar el color verde."

La siguiente es la muestra de conjunto de datos:

DatetimeCulpa
12/20/2020 10:05:00Falso
12/20/2020 11:15:00Verdad
12/20/2020 11:15:00Falso
12/20/2020 09:15:00Falso

Por favor, sugiera cómo lograr esto.

Gracias

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jitpbi , Crear esta medida, Esta medida en formato condicional con la opción "Valor de campo"

if(isblank(countx(filter(Table[Fault] ?"True" && Table[DateTime] >- now() - time(1,0,0) && Table[DateTime] <- now()), Table[Fault])), "green", "red")

referencia para el paso

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@jitpbi , Crear esta medida, Esta medida en formato condicional con la opción "Valor de campo"

if(isblank(countx(filter(Table[Fault] ?"True" && Table[DateTime] >- now() - time(1,0,0) && Table[DateTime] <- now()), Table[Fault])), "green", "red")

referencia para el paso

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

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.