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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
LauraBueno
Helper III
Helper III

conditional format matrix

Hello everyone

I'm trying to apply conditional formatting to an array depending on the values displayed (more negative values will be red and moving green as the values become more positive). However, conditional formatting is applied on all columns and I would like this comparison to be displayed in the array. Is there any way to do this?

This is the table I have. I would like to display the color format (red - green) for the delta vs Reference variable for each of the swatches. However, when I apply conditional formatting, the color is applied by comparing all swatches (since the variable is the same). Is there a way to break it by column (shown as in the table below)?

table.png

Thank you

Laura

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi @LauraBueno   ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @LauraBueno ,

 

Did you choose the right field to set conditional format? You may select on the [delta vs Reference], right-click or select the down-arrow next to the field in the Values well that you want to format. Select Conditional formatting, and then select the type of formatting to apply.

 

For reference:

Use conditional formatting in tables

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AllisonKennedy
Community Champion
Community Champion

You could achieve close to what you want by creating a rank measure that ranks within each Sample, and using that RANK measure as the value for the conditional formatting. So your table would be formatted with 4 different colour rather than a relative scale. So you could easily see which row in each column/array is the highest and lowest, but not easily see by how much they differ.

Here's one resource for RANKX, but there's lots of ways to use it, including putting it in MEASURE instead of column: 

https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

Has this post solved your problem? Please mark it as a 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.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

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

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@LauraBueno 

not sure I got it. But you can create a color measure on dimension values and measure values like this

 

Color Date = if(FIRSTNONBLANK(Table[date],TODAY()) <today(),"lightgreen","red")
if(FIRSTNONBLANK(Table[Value],"true") "true","green","red")


Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))

Color  = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 
,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

 

 

And this can be used in conditional formatting after selecting "Field". Once you use it one column , it will be there for all samples

 

refer:
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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.