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
WestWinter
Helper II
Helper II

Creating a 100% stacked bar chart off of conditions

RegionCountryValueCondition
AsiaChina10003
AsiaJapan5002
AsiaKorea2501
AmericaUSA10003
AmericaCanada5002

 

So I have the above table... Would like to create a 100% stacked bar chart off of the conditions (3 = Green, 2 = Yellow, 1 = Red)

 

I've tried 

Measure = IF(metrics[Condition] = 3, "GREEN", IF(metrics[Condition] = 2, "YELLOW", "RED"))

But it does show up as values in my table, but I could not seem to input it into the bar chart.

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @WestWinter ,

 

Is there any field placed in the Legend pane?

 

vkkfmsft_0-1630372446909.png

 

If so, I think you have to change the color manually in the Data colors. 

 

vkkfmsft_1-1630372867006.png

 

If not, you can format the data color using the measure.

 

vkkfmsft_2-1630372950083.png     vkkfmsft_3-1630372990324.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

VahidDM
Super User
Super User

Hi @WestWinter 

 

Try to add a column to your table with this measure:

Measure =
SWITCH ( metrics[Condition], 3, "GREEN", 2, "YELLOW", 1, "RED" )

Table  will be like this:

VahidDM_0-1630224278116.png

Then use it in the chart:

VahidDM_2-1630224333740.png

 

 

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

Appreciate your Kudos VahidDM_1-1630224300731.png !!

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.