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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tloewen98
Frequent Visitor

Changing the color of rows in a table

I am working on a report that shows our current inventory and our minimum on hand inventory quantity. If the current inventroy is lower than what our min is then I want to highlight these records in red. I have watched a few videos that suggest creating a measure that looks something like this: 

 

if( [currentonhandinventory] < [minimumonhandinventory], "red" )

 

Has anyone ever done something like this? any responses will be helpful. 

 

 

3 REPLIES 3
ribisht17
Super User
Super User

@tloewen98 

 

Color based on a calculation

You can create a calculation that outputs different values based on business logic conditions you select. Creating a formula is usually faster than creating multiple rules in the conditional formatting dialog.

For example, the following formula applies hex color values to a new Affordability rank column, based on existing Affordability column values:

 

 

To apply the colors, select Background color or Font color conditional formatting for the Affordability column, and base the formatting on the Field value of the Affordability rank column.

 

 

The example table with Affordability background color based on calculated Affordability rank looks like this:

 

 

You can create many more variations, just by using your imagination and some calculations.

 

Related Blog

powerbi - Power BI: How to conditionally format a row of a table in Power BI DAX - Stack Overflow

 

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 

 

 

Thank you for the quick response @ribisht17 . I am trying to follow along with what you are saying but anything you might have posted after the ":" did not post. I am unable to see the formula and the example that you were able to provide. I am using the link you have also added. 

 

Thanks

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.