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
prasanna30
Regular Visitor

Conditional Formatting For Showcasing machine status

 

Hi,

We have requirement where we need to show  machine status with color coding in Direct Query mode in Power BI. For example If machine status is running  at  a particular time it should be shown in green color  and after  some time if machine status becomes faulted then it should be shown in red. The data is refreshed at interval of 5 minutes and machine status is changing  after 5 minutes. See below image for exact requirement

machinestatus.png

I wanted to have exact same color coding for different machine status. I have used Table HeatMap custom visuals from contnet store but the limitation of that is you can only have 1 color  range  and you can not assign different color for different status.

 

Please guide me how I can achieve this in Power BI . Any workaround will be highly appreciated.

 

Thanks in Advance.

 

 

Thanks,

Prasanna30

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@prasanna30

One workaround I can think of is to use the table visual showing status images.

Capture.PNG

 

status_img =
SWITCH (
    TRUE (),
    Table1[status] = "Running", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAIAAACM6x0lAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA6SURBVFhH7c8BCQAgEAAxs5jny35Daww5WIGdu/OBGpIakhqSGpIakhqSGpIakhqSGpIakhqSLxo7D0x+hDYkGySFAAAAAElFTkSuQmCC",
    Table1[status] = "Maint", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAYAAAADiYpyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAABOSURBVFhH7dBBDcAwEMCw6wCMP6Wi6qQqLGZ/8s86+z3DPPX3jIgRMSJGxIgYESNiRIyIETEiRsSIGBEjYkSMiBExIkbEiBgRI2LENfMBDUoDCcxgbGIAAAAASUVORK5CYII=",
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAYAAAADiYpyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAABPSURBVFhH7dCxDYAwEMDAD3NQZv/NmIFIyFtw17j3eu79DnPV3zMiRsSIGBEjYkSMiBExIkbEiBgRI2JEjIgRMSJGxIgYESNiRIyIEZ+ZA0jsAmDt8I9DAAAAAElFTkSuQmCC"
)

You can create the images in windows painter and convert them to base64 strings, see this link.

Capture.PNG

 

Capture.PNG

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee

@prasanna30

One workaround I can think of is to use the table visual showing status images.

Capture.PNG

 

status_img =
SWITCH (
    TRUE (),
    Table1[status] = "Running", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAIAAACM6x0lAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA6SURBVFhH7c8BCQAgEAAxs5jny35Daww5WIGdu/OBGpIakhqSGpIakhqSGpIakhqSGpIakhqSLxo7D0x+hDYkGySFAAAAAElFTkSuQmCC",
    Table1[status] = "Maint", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAYAAAADiYpyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAABOSURBVFhH7dBBDcAwEMCw6wCMP6Wi6qQqLGZ/8s86+z3DPPX3jIgRMSJGxIgYESNiRIyIETEiRsSIGBEjYkSMiBExIkbEiBgRI2LENfMBDUoDCcxgbGIAAAAASUVORK5CYII=",
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAaCAYAAAADiYpyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAABPSURBVFhH7dCxDYAwEMDAD3NQZv/NmIFIyFtw17j3eu79DnPV3zMiRsSIGBEjYkSMiBExIkbEiBgRI2JEjIgRMSJGxIgYESNiRIyIEZ+ZA0jsAmDt8I9DAAAAAElFTkSuQmCC"
)

You can create the images in windows painter and convert them to base64 strings, see this link.

Capture.PNG

 

Capture.PNG

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.