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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors