简体   繁体   English

power bi 表格单元格的条件格式

[英]Conditional formatting of power bi table cell

i have a table for product in power bi.我有一张 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?是否可以将开关 function 与文本一起使用?

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 :然后右键单击可视化窗格中的每个字段和 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:根据制作的列,使用First summarization 将其格式化为Field value ,您将获得所需的突出显示:

在此处输入图像描述

See Use conditional formatting in tables for more information.有关详细信息,请参阅在表格中使用条件格式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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