cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kvijayrs173 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

Re: Data colors based on another field values

@kvijayrs173

 

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
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




9 REPLIES 9
Super User
Super User

Re: Data colors based on another field values

@kvijayrs173

 

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

 

Regards

 

Victor

 




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




kvijayrs173 Frequent Visitor
Frequent Visitor

Re: Data colors based on another field values

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

Community Support Team
Community Support Team

Re: Data colors based on another field values

Hi @kvijayrs173,

 

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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
kvijayrs173 Frequent Visitor
Frequent Visitor

Re: Data colors based on another field values

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

Highlighted
ravik4934 Member
Member

Re: Data colors based on another field values

Hi @kvijayrs173,

 

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

kvijayrs173 Frequent Visitor
Frequent Visitor

Re: Data colors based on another field values

Hi Ravi,

 

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


@ravik4934 wrote:

Hi @kvijayrs173,

 

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


 

ravik4934 Member
Member

Re: Data colors based on another field values

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

 

LMeijdam Established Member
Established Member

Re: Data colors based on another field values

Hi @kvijayrs173,

 

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

Super User
Super User

Re: Data colors based on another field values

@kvijayrs173

 

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
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!