Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I am not reaching to correct soultion to change the background color of visual based on the below condition:
"On the card visual need to show the background color based on the "Fault" value in the last 1 hour. if the fault value is "True" in the last one hour then it should show red color otherwise it should show green color."
The below is the sample of dataset:
DateTime | Fault |
12/20/2020 10:05:00 | False |
12/20/2020 11:15:00 | True |
12/20/2020 11:15:00 | False |
12/20/2020 09:15:00 | False |
Please suggest how to achieve this.
Thanks
Solved! Go to Solution.
@jitpbi , Create this measure, You this measure in conditional formatting with "Field value" option
if(isblank(countx(filter(Table[Fault] ="True" && Table[DateTime] >= now() - time(1,0,0) && Table[DateTime] <= now() ),Table[Fault])), "green", "red")
refer for step
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
@jitpbi , Create this measure, You this measure in conditional formatting with "Field value" option
if(isblank(countx(filter(Table[Fault] ="True" && Table[DateTime] >= now() - time(1,0,0) && Table[DateTime] <= now() ),Table[Fault])), "green", "red")
refer for step
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