Conditional Formatting Measures for Text in Columns
I have safety audit data updated 24 hours daily during turnaround events on a plant site. I update my PowerBI report twice daily. There are different color codes in different columns depending on the type of data being reported, but those colors do not come forward into my Power BI Desktop queries. I want to be able to conditionally format those same columns in the same manner as the original data, but cannot seem to write the correct DAX code in the Quick Measures to get it to work (background is one color, text is another color and might be bold). I need assistance with this ASAP as we are in the middle of a turnaround and I need to format this table. Thank everyone in advance for your assistance! Have a wonderful day!
Dana Buck commented
So, having found a step-by-step procedure that seemed closest to what I wanted to do, written by Matt Allington on March 14, 2019 and updated on August 28 2019, here is the DAX code I came up with:
VAR swp = SELECTEDVALUE('2019 HMDH2 SafetyAudit Data'[SWP Audit?])
RETURN IF(swp <"Yes"> "#FFDSB9", "#FFFFFF" "#000000")
What I am trying to say is that if the selection in the SWP Audit column says "Yes," then I want the cell to be a light salmon fill, with black text, and otherwise, the text needs to stay with white fill and no text (I don't know the hex value for NO fill). However, I get the following error message and I don't quite understand what it means:
The syntax for '"Yes"' is incorrect. (DAX(VAR swp = SELECTEDVALUE('2019 HMDH2 SafetyAudit Data'[SWP Audit?])RETURN IF(swp "Yes" "#FFDSB9", "#FFFFFF" "#000000"))).
I understand that it means what I typed for YES is incorrect. I simply don't know how to make it correct. Any assistance will be appreciated.