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
PowerBI_Scott
Frequent Visitor

Colors for a value that does not exist yet

Is there a way to assign a color to a bar or line in a "Line and stacked column chart" or "Line and clustered column chart" where the data point does not exist yet.

 

For example, we have 4 customers:

Walmart

Target

Kroger

Safeway

 

We are adding Publix.  As soon as Publix goes on-line it should show up in the charts.  The colors for each customer is predefined, so I'm trying to avoid a situation where Publix shows up one day and it is assigned a random color. (Additional request: It would be nice to assign global colors to certain values, unfortunately the conditional formatting doesn't appear as an option.  If there is a way to easily assign global colors let me know, please.)

 

Is there an easy way to select a color for a value in a legend/bar/line when data does not exist in the dataset?

1 ACCEPTED SOLUTION
PowerBI_Scott
Frequent Visitor

Thanks for the suggestion.  I have the tables using values from a dimension table, but with no data, it was still not coming up as an option.

Your suggestion gave me another idea.  Rather than manually creating a tables for everything (which would have been very painful), I modified the data that was loaded to return the value I wanted in place of one of the others (e.g., CASE WHEN customer = 'Kroger' THEN 'Publix' etc.).

 

It would still be best if there was a place I could assign a global color for certain values, but for now this works.

 

Thanks again!

 

View solution in original post

2 REPLIES 2
PowerBI_Scott
Frequent Visitor

Thanks for the suggestion.  I have the tables using values from a dimension table, but with no data, it was still not coming up as an option.

Your suggestion gave me another idea.  Rather than manually creating a tables for everything (which would have been very painful), I modified the data that was loaded to return the value I wanted in place of one of the others (e.g., CASE WHEN customer = 'Kroger' THEN 'Publix' etc.).

 

It would still be best if there was a place I could assign a global color for certain values, but for now this works.

 

Thanks again!

 

ppm1
Solution Sage
Solution Sage

Not necessarily "easy" but you could add a table of all future expected values with the desired hexcode color (or just add hexcode to an existing dimension table that has all expected future values. You could then create a measure that grabs that value based and use it as the conditional formatting value for each bar.

 

Pat

Microsoft Employee

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.