[英]Power BI: How to conditionally format a row of a table in Power BI DAX
I am new to DAX and I need help to colour the background of a row in table using DAX.我是 DAX 新手,我需要帮助使用 DAX 为表格中的一行背景着色。
Name![]() |
text![]() |
---|---|
Book![]() |
Ora![]() |
Pencil![]() |
hjui![]() |
I want to colour the entire row of table with Name = Book in ORange我想用 Name = Book in ORange 为整行表着色
Can someone help me有人能帮我吗
Yes, it is possible using conditional formatting .是的,可以使用条件格式。
In the Fields
pane, right click your table and create the following measure:在“
Fields
窗格中,右键单击您的表并创建以下度量:
Background color = IF(MAX('Table'[Name]) = "Book", "Orange", BLANK())
Then select the table visual and in Visualizations
pane, right click each of the columns and select Conditional formatting
-> Background color
:然后 select 表格视觉和在
Visualizations
窗格中,右键单击每一列和 select Conditional formatting
- > Background color
:
In Format by
select Field value
and select the above created measure in Based on field
:在 select
Field value
和 select Format by
中,上述Based on field
创建的度量:
After you do that for each column shown, the result will be as follows:对显示的每一列执行此操作后,结果将如下所示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.