The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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