Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.