Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
M_B
Contributor III
Contributor III

Apply conditional color for each measure. Grouped bars on single dimension.

Hello,

I have been trying to a few days now to get this thing to work and has become quite aggravating. In a "Bar Chart", I have 1 dimension and 3 measures. The measures are all calculated as a percentage (%) and I am trying to give each measure its own conditional colors. For example, the bar chart has the following dimension and measures:

Dim1

Mes1 being Sum(Mes1)/Count(Mes1)

Mes2 being Sum(Mes2)/Count(Mes2)

Mes3 being Sum(Mes3)/Count(Mes3)

The condition is the same for all measures but of course every measure is going to its different value:

If(Sum(Mes#)/Count(Mes#) < 0.7, Red(), If(Sum(Mes#)/Count(Mes#) < 0.9, Yellow(), If(Sum(Mes#)/Count(Mes#) <= 1, Green(), Null())))

When I go to Appearance>Colors and legend, coloring by measure applies the condition of 1 measure for all 3. Coloring by expression is impossible to figure out without knowing what the software wants done internally.

I have been searching and looking up solutions on the community forums and the help articles trying to find a function that can help me. Made master measures and whatnot and still can't seem to accomplish this.

I have worked with BI software that was already years older than it was when I started working with it years ago and achieving this did not require any funny tricks or weird workarounds. Doing something like this should not be a mystery to solve.

Any help would be appreciated.

Labels (1)
1 Solution

Accepted Solutions
rodrigo_martins
Partner - Creator
Partner - Creator

Hello,

What you are wanting to do is possible with the combination chart. For each measure, you can define the presentation form (bar, line or marker) and the color, which can be fixed or an expression. This way you can create different expressions for each measure (if they have different parameters), or even different colors if necessary. It is also possible (and recommended) to use a variable to store this expression if you reuse it several times in the application.

Just click on "More properties" within the measure to access these other settings.

rodrigo_martins_1-1720700189649.png

Hope this helps!

View solution in original post

2 Replies
rodrigo_martins
Partner - Creator
Partner - Creator

Hello,

What you are wanting to do is possible with the combination chart. For each measure, you can define the presentation form (bar, line or marker) and the color, which can be fixed or an expression. This way you can create different expressions for each measure (if they have different parameters), or even different colors if necessary. It is also possible (and recommended) to use a variable to store this expression if you reuse it several times in the application.

Just click on "More properties" within the measure to access these other settings.

rodrigo_martins_1-1720700189649.png

Hope this helps!

M_B
Contributor III
Contributor III
Author

Hello Mr. Martins,

I appreciate your reply. It sure did help. Thank you very much. It worked as I pictured the bar chart to work. I simply converted the chart and applied the expressions for each measure.

Hopefully this topic and your answer will help others.