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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Color bar chart based on value in another table & column

Hello,

 

Is there a way to color a bar chart's bars based on values in another table & column? I have one table which displays fault codes and their occurrences, and another table that relates those fault codes to fault levels. 

 

I have tried conditional formatting and creating DAX measures, but each of those wants me to aggregate the fault level column. which I do not need. Essentially I need conditional formatting along the lines of (in pseudocode):

if fault_level = "0 - No Reaction", color those bars blue, else if fault_level = "1 - Dash Telltale Only", color those bars green, else if fault_level = "2 - Torque Limited to 35%", color those bars yellow, else if fault_level = "3 - Zero Torque", color those bars orange, else if fault_level = "4 - Vehicle Shutdown", color those bars red.

 

For example, if fault 234 has a fault level of zero, I want that bar to be blue. If fault level has a fault level of 3, I want that to be orange.

 

Please see the screenshots below.

 

IDC_0-1694617938371.pngIDC_1-1694617962573.png

 

I tried conditional formatting, but the summarization is not needed and it won't let me conditionally format without it.

IDC_0-1694618607949.png

Any help would be deeply appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured it out, I needed to add a legend with the same column I was conditionally formatting with.

View solution in original post

3 REPLIES 3
christinepayton
Super User
Super User

Does it work with that summarization? Usually as long as the summarization doesn't do something you don't want it to be doing, it's fine to let it do its thing. In this case, if it's getting the first fault level, and you have a rule for each fault level, I'd expect it to work fine assuming your relationship is flowing in the right direction. 

Anonymous
Not applicable

I figured it out, I needed to add a legend with the same column I was conditionally formatting with.

Anonymous
Not applicable

It does not, unfortunately. The bar chart in the attached screenshot in my previous post is the result of the conditional formatting I also screenshotted in the previous post. Initially, the bar chart was a darker blue.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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