Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

DAX query to colour front in red or green

HI guys, I want to change my font colour into green or red depending on dax formula so my ask is, campare asset number from table 1 with table 2, IF the assest number matchs then color the amount field to green else colour the amount as red (If it does'nt match), i want as dax formula for this 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

got it, Please use this for ref , ##Font Color Measure =
IF(
COUNTROWS(
FILTER(
'table 1',
'table 1'[values] IN VALUES('table 2'[values])
)
) > 0,
"Green",
"Red"
)
##

then after this go to

1.In the "Visualizations" pane, select the table visual and go to the "Conditional formatting" section.

2.Choose the value or column that you want to format based on the measure. For example, if you want to format the "Value" column, select it. then select rules and give string value as green and change the color as green and so on for red too. 

 

please if you find it helpful like it.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

got it, Please use this for ref , ##Font Color Measure =
IF(
COUNTROWS(
FILTER(
'table 1',
'table 1'[values] IN VALUES('table 2'[values])
)
) > 0,
"Green",
"Red"
)
##

then after this go to

1.In the "Visualizations" pane, select the table visual and go to the "Conditional formatting" section.

2.Choose the value or column that you want to format based on the measure. For example, if you want to format the "Value" column, select it. then select rules and give string value as green and change the color as green and so on for red too. 

 

please if you find it helpful like it.

pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
You can use this type of dax to change the font color dynamically .
For example :-

Measure Value Color = SWITCH(TRUE();
                               [Measure Value] <=1;"#000000";
                               [Measure Value] <99,5;"#e60000";
                               [Measure Value] <100,5;"#000000";
                               [Measure Value] <999999;"#2d862d";
                               "#000000"
                             )   

 You can also refer to these links :-
https://databear.com/changing-colours-using-dax-and-conditional-formatting-in-power-bi/

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column

Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

it working only when you have values inside singel table but i would like to compare the values or columns from 2 diffrent table and see the match, If match is found then give it as green else give as red.

How you are comparing.. which type of visual you are using.. can we have snap of your data model to understand it better

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.