简体   繁体   中英

Conditional formatting of power bi table cell

i have a table for product in power bi. It has a column called sales rate.it has a text value “high,medium,low”.i want to add a conditional formatting to it. If it is high,the background of a cell should be red.if it is medium, background of a cell should be yellow.otherwise it will be green. How i can do it? And is it possible to use switch function with text?

You can make a new column, like this:

Column = SWITCH('Table'[Sales rate]; "high"; "red"; "medium"; "yellow"; "low"; "green")

Then right click each of the fields in Visualizations pane and select Conditional formatting -> Background color :

在此处输入图像描述

Format it by Field value , based on the column made, with First summarization, and you will get the highlighting you want:

在此处输入图像描述

See Use conditional formatting in tables for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM