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
mumbea
New Member

How can I change color for different bar where the legend is on the same bar

Hi everyone, after searching for days in this forum I haven't find the answer to my problem. I have two measures and the total, divided for companies and for years. I want a multiple bar chart where are shown both measures on the same column (with different color) for each company grouped by year.

This are the kind of data.

Companyyearvaluemeasure
A20205big
A20196big
A20187big
B20205big
B20196big
B20187big
C20205big
C20196big
C20187big
A2020-1little
A2019-0.5little
A20180.2little
B2020-1little
B2019-0.5little
B20180.2little
C2020-1little
C2019-0.5little
C20180.2little

 

I want the year on the X axis, grouped by company ( as legend do) and I want to have the total breakdown (with different color) for big and little measures. So I want to use 6 colors. To do something acceptable I make three bar chart for the years and then I use the company as X axis with the legend made by the variable "measure". For me it is ok even to make three graphics, but I want to use different color for each company (for example the companies red, green and blue, but with that color light for big and dark for little).

I know is something strange, I hope you can help me.

 

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @mumbea ,

 

You can't have two legend fields in a stacked column chart. Maybe you should consider to use custom visuals.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
mumbea
New Member

Thank you @amitchandak and @amitchandak for the answers, this is what I've done and what I want. I want the separation of the two component and each bar with a couple of color. Up in the picture I divide by year and I use the measure to separate on the same column, down there is my dream, but I can't underline the two part of the sum. The solution made by Pragati11 is good, but I can't see well how much 'small' is big related to 'big'

Thank you in advance

 

IMG_20210309_105824.jpg

 

Pragati11
Super User
Super User

Hi @mumbea ,

 

You can use a BAR CHART visual with Small Multiples in it. Somehting like below:

Pragati11_0-1615283406432.png

You can format the chart for colours, labelling etc. as per your need.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@mumbea , the Expected output is not clear. But conditional formatting does work with legend and more than one measure.

You can have a measure and both columns on-axis and try conditional formatting. Refer to the power bi part in this video - https://www.youtube.com/watch?v=2P5BBRN853c

 

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.