Forum Discussion
Power BI conditional formatting text
Hello
I would like to set the conditional formatting of color for the lable column as below. I tried several measure in this community, and it does not work. It appears the isssu is caused by the special character in the column text. Please help.
Thanks
JIN
Ryanc2258 , if you have created a measure like these
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red") Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow")) Color = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 ,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow")) Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")In conditional formatting, you have to choose field option and then this measure.
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
3 Replies
- amitchandakSuper User
Ryanc2258 , if you have created a measure like these
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red") Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow")) Color = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 ,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow")) Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")In conditional formatting, you have to choose field option and then this measure.
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 - AnonymousNot applicable
Hi Ryanc2258 ,
How did you make conditional formatting for Label field? Set the background color of Lable filed to the color in the double quotes of the corresponding field value? If yes, you can create a measure as below and format Label field base on this new created measure... I created a sample pbix file for you, you can also get other methods from the sample file.
Measure = VAR _label = MAX ( 'Conditional Formatting_2'[Label] ) VAR _llabel = LEFT ( _label, LEN ( _label ) - 1 ) RETURN RIGHT ( _llabel, LEN ( _llabel ) - 1 )Best Regards
Rena
- Ryanc2258Helper I
Issue solved. Thank you very much.