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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JPINE
New Member

Dynamically Change Colors in Power BI for Different Product Names

I have a a table containing a Product Name column with many different product names that can be somewhat long (several words) and new product names are being added all of the time.  Is there a way to not only add different colors to the current product names but automatically color any new product names that are added (without having to add the additional procuct and name in an expression)?  Once this is accompished, I want to color code the entire row (that has related information about that product) the same color as the product name.

 

Thank you for any suggestions, as I am very new to this.

1 ACCEPTED SOLUTION
v-saisrao-msft
Community Support
Community Support

Hi @JPINE,

Thank you for reaching out to the Microsoft Fabric Forum Community. 

Thank you @lbendlin, for your insights.

To automate the color coding of product names in Power BI, including for new products, you can follow these steps to apply dynamic and consistent color formatting without manually updating each new product. 

  • Create a measure in Power BI to automatically assign a unique color to each product name. This should use a method that ensures each product name consistently gets a specific color, even when new products are added. Consider using a hash function or similar logic to map each product name to a color automatically. The goal is to define this mapping in a way that doesn't require manual updates as new products are introduced. 
  • Once you have set up the dynamic color measure, you can apply it to the "Product Name" column using Power BI’s Conditional Formatting feature. This will automatically color-code the product names based on your defined logic, ensuring consistency. 
  • To ensure the entire row containing product information is color-coded, apply the same color measure to other columns in your table visual. By setting conditional formatting for each additional column to match the color measure, the entire row will adopt the same color as the product name, creating a cohesive visual display. 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you. 

View solution in original post

5 REPLIES 5
v-saisrao-msft
Community Support
Community Support

Hi @JPINE,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @JPINE,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @JPINE,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @JPINE,

Thank you for reaching out to the Microsoft Fabric Forum Community. 

Thank you @lbendlin, for your insights.

To automate the color coding of product names in Power BI, including for new products, you can follow these steps to apply dynamic and consistent color formatting without manually updating each new product. 

  • Create a measure in Power BI to automatically assign a unique color to each product name. This should use a method that ensures each product name consistently gets a specific color, even when new products are added. Consider using a hash function or similar logic to map each product name to a color automatically. The goal is to define this mapping in a way that doesn't require manual updates as new products are introduced. 
  • Once you have set up the dynamic color measure, you can apply it to the "Product Name" column using Power BI’s Conditional Formatting feature. This will automatically color-code the product names based on your defined logic, ensuring consistency. 
  • To ensure the entire row containing product information is color-coded, apply the same color measure to other columns in your table visual. By setting conditional formatting for each additional column to match the color measure, the entire row will adopt the same color as the product name, creating a cohesive visual display. 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you. 

lbendlin
Super User
Super User

 but automatically color any new product names

What's your definition of "new" ?  Power BI has no memory, so you need to provided a hint.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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