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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

 

v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors