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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Cretemeausernam
Regular Visitor

define visual labels by table?

Hi,

 

I have a table of data sorted in this manner:

 

CategoryValue
A67
F76
A45
B30

 

I have a 2nd table with Category properties on it which includes hex colours

 

CategoryOriginColour

A

Europe118DFF
BAsiaAD5129
FUSAEC8FCA

 

 

What I'm trying to do is use the colour column in the category table to define the colour the category has in various visuals through reports (pie charts, stacked bar charts, line graphs)

 

This reason I don't want to do this manually is because the category table has 100s of rows.

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

Hi, @Cretemeausernam 

 

It is unsupported to format color for multiple visuals in Power BI Desktop currently. Visuals have different data points. You need to set a format for a specific visual. For tables and matrixs, you may use conditional formatting . For some other visuals, you need to define format for 'Data color'.

 

I created sample data to reproduce your scenario. You may try the following measure.

Measure = 
LOOKUPVALUE(Category[Colour],Category[Category],SELECTEDVALUE('Table'[Category]))

 

Conditional formatting for table visuals:

b1.png

 

Format for clustered column chart:

b2.png

 

Best Regards

Allan

 

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

 

 

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Cretemeausernam 

 

It is unsupported to format color for multiple visuals in Power BI Desktop currently. Visuals have different data points. You need to set a format for a specific visual. For tables and matrixs, you may use conditional formatting . For some other visuals, you need to define format for 'Data color'.

 

I created sample data to reproduce your scenario. You may try the following measure.

Measure = 
LOOKUPVALUE(Category[Colour],Category[Category],SELECTEDVALUE('Table'[Category]))

 

Conditional formatting for table visuals:

b1.png

 

Format for clustered column chart:

b2.png

 

Best Regards

Allan

 

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

 

 

mahoneypat
Microsoft Employee
Microsoft Employee

In query editor on transform tab, add # as a prefix to your colour column.  Then you can just use a measure like this to get your color code in a measure.  I named your example table Colors.  If you use Origin column in a visual, this will return you can use for the color (click on the fx button next to the color, choose Field Value and this new measure).

 

Origin Color = SELECTEDVALUE(Colors[Colour])
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors