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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Data colors based on another field values

I am pretty new to POWER BI. I have the below chart in Tableau and am trying to replicate this on to POWER BI. But not finding the option.

 

I have two Charts - Category and count of tickets, Subcategory and count of tickets. In Tableau I created a chart for Subcategory and simply drag-drop the Category field to color control. Which will give me the Subcategory bars coloured based on their respective Categry values. But struggling to find this option in POWER BI. Do we have this option in POWER BI ?

 

If you look at the "EUSR Provisioning" in the first chart, we have to subcategories underneath it which is Provision and Deprovision. Now the same color is applied in the second chart. I have this in Tableau but not sure on how to do this in POWER BI

 

 Capture1.PNG

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, look the PBIX. with Conditional formatting you can create a measure and assign a color to each category (Yes, you need to know all the categories).

 

imgFormat.png

 

ColorFormat =
SWITCH (
    SELECTEDVALUE ( Table1[Category] ),
    "A"; "#000000",
    "B"; "#ff0000",
    "C"; "#ffa500",
    "D"; "#551a8b",
    "E"; "#98fb98"
)

A sample is attached.

 

Regards

 

Victor

 




Lima - Peru

View solution in original post

12 REPLIES 12
Anonymous
Not applicable

Same here, I have graphs with more than 50 categories and it takes a lot of time formatting one by one.
If someone can help us please!!!

how it looks in tableau vs how it looks in power bi

Picture1.jpgPicture2.jpg

Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, look the PBIX. with Conditional formatting you can create a measure and assign a color to each category (Yes, you need to know all the categories).

 

imgFormat.png

 

ColorFormat =
SWITCH (
    SELECTEDVALUE ( Table1[Category] ),
    "A"; "#000000",
    "B"; "#ff0000",
    "C"; "#ffa500",
    "D"; "#551a8b",
    "E"; "#98fb98"
)

A sample is attached.

 

Regards

 

Victor

 




Lima - Peru
Anonymous
Not applicable

Do you know if it's possible to do this by using a table?  I have a table of vendors that I use across multiple Power BI reports that I'd like to be able to assign colors to for graphs/charts across the board rather than use as a measure.  

Same here, I have the category colors in a database table and I'd like to use it in PBI visuals.

Any help achieving this would be great.

 

Anonymous
Not applicable

Hi @Anonymous,

 

I think conditional formatting feature will suitable for your requirement, but current it seems only works on table and matrix visuals.

Conditional formatting in tables

 

Maybe you can submit an idea for add support for more visuals.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Thanks for your suggestions. I will try submitting the idea..

Anonymous
Not applicable

Hi @Anonymous,

 

If you did post an idea could you perhaps share a link to it ? This way it will be easier for other people following this thread to also upvote  your idea!

 

Best regards,

L.Meijdam

Anonymous
Not applicable

Hi @Anonymous,

 

Have you tried putting the category in the legend? Or if possible could you please share a sample of your data. I believe it is achievable in power bi. 

 

 

Best Regards,

Ravi

Anonymous
Not applicable

Hi Ravi,

 

Yes definitely I can share the file. Is there any attachment option to attach the file here..? Please let me know


@Anonymous wrote:

Hi @Anonymous,

 

Have you tried putting the category in the legend? Or if possible could you please share a sample of your data. I believe it is achievable in power bi. 

 

 

Best Regards,

Ravi


 

Anonymous
Not applicable

You can upload in G-drive or One Drive then just share the link here. Smiley Happy

 

Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, In a direct way (with a drag and drop or selecting an option) is not possible for the moment.

 

Regards

 

Victor

 




Lima - Peru
Anonymous
Not applicable

Any other indirect way please. Kindly share your ideas on to achieve this requirement please.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.