Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a field (data type text) called test that has some rows with Y and other empty
I need to color the rows in a table with yellow color if the field test is Y and white if it's empty.
I don't need to show the field test on the table.
How can I do?
Solved! Go to Solution.
@Giada_Togliatti , you can create a color measure and use that after selecting field option
example
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"
)
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
You could create a simple measure as below:
Measure = IF(CALCULATE(MAX('Table'[test]))="Y",1,2)
Then do conditional formatting as below:
and for "I don't need to show the field test on the table."
you'd better show it(test field) in the table visual. if one value has "Y" and empty together, how do you color it?
for example:
In my simple sample, D has "Y" and empty in test, if you don't drag test in the table visual.
Result:
and here is my sample pbix file, please try it.
Regards,
Lin
@Giada_Togliatti , you can create a color measure and use that after selecting field option
example
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"
)
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
Change the values of the "Y / Blank" to "1 / 0" then apply a conditional formatting on each column you want formatted.
Use the "based on field" together with format by rules.
Br,
J
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
52 | |
39 | |
26 |
User | Count |
---|---|
80 | |
57 | |
45 | |
44 | |
35 |