Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Is there a way to change the font colour of a text column [BRAG STATUS] with the values "Green", "Amber" & "Red"
I'm able to use conditional formatting to get a value by field for the first values (see pic attached) but it doesn't pick up the amber colour:
I've even tried to use a switch function to change the HEX colours but I still cant quite get it
Conditional Colour Format = SWITCH(TRUE(),MAX(audit_results[BRAG STATUS])="Green",1,MAX(audit_results[BRAG STATUS])="Amber",2,MAX(audit_results[BRAG STATUS])="Red",3)
Any help on this would be great!
Thanks,
Solved! Go to Solution.
@Anonymous
BRAG STATUS | Column2 |
Red | 1 |
Amber | 2 |
Green | 3 |
Red | 4 |
Amber | 5 |
Green | 6 |
Red | 2 |
DAX measure
Conditional_Colour_Format =
VAR __status =
CALCULATE ( FIRSTNONBLANK ( audit_results[BRAG STATUS], TRUE () ) )
VAR __color =
SWITCH ( __status, "Green", "#4CAF50", "Amber", "#FFC107", "Red", "#f44336" )
RETURN
__color
@Anonymous
BRAG STATUS | Column2 |
Red | 1 |
Amber | 2 |
Green | 3 |
Red | 4 |
Amber | 5 |
Green | 6 |
Red | 2 |
DAX measure
Conditional_Colour_Format =
VAR __status =
CALCULATE ( FIRSTNONBLANK ( audit_results[BRAG STATUS], TRUE () ) )
VAR __color =
SWITCH ( __status, "Green", "#4CAF50", "Amber", "#FFC107", "Red", "#f44336" )
RETURN
__color
@Anonymous , As per this Amber is supported
https://blog.crossjoin.co.uk/2018/08/10/colour-names-supported-in-power-bi-conditional-formatting/
Hexcode you have to return with #. Hope you are using "Field" option and measure. Make sure you created a measure not column
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
I have this measure but it cant load the data for the visual:
HI @Anonymous ,
See if this helps.
https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/
Regards,
Harsh Nathani
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
21 | |
19 | |
14 | |
11 |
User | Count |
---|---|
43 | |
35 | |
25 | |
24 | |
22 |