amitdigga
amitdigga

Reputation: 7178

How to use table values for data colors?

I want to visualize reports of bikes. Now bike comes in 150 different color models. I have color values (in hash) for each model. I want to visualize power bi reports with bike's actual colors (not arbitrary colors assigned by power bi)

Model to Color

Model Color
Model1 #aaaaaa
Model2 #bbbbbb

Model to Sale

Model Sale
Model1 10
Model2 20

How to do that in power bi? How to reference from color table instead of manually putting data color for each model?

Upvotes: 0

Views: 256

Answers (1)

Olly
Olly

Reputation: 7891

With the following relationship:

enter image description here

You can create a measure to return the appropriate color:

Model Color = SELECTEDVALUE ('Model to Color'[Color] )

Now apply background conditional formatting, using this measure:

enter image description here

And your model field is coloured according to the Model by Color value:

enter image description here

Upvotes: 1

Related Questions