Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I have a bar graph with a average line. New information is constantly pulled so the average changes daily. Is it possible to conditional format the bar colors based on this average? Such as above the average Green and below Red.
Solved! Go to Solution.
Hi, @Anonymous ;
You could create a measure ,then apply it into data color:
1.create a measure.
Measure = IF(SUM([value])> CALCULATE( AVERAGE('Table'[value]),ALL('Table')),"green","red")
2.apply it into data color.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
You could create a measure ,then apply it into data color:
1.create a measure.
Measure = IF(SUM([value])> CALCULATE( AVERAGE('Table'[value]),ALL('Table')),"green","red")
2.apply it into data color.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you define a measure for the average, then this should be possible with conditional formatting.
These articles should provide much more detail on the specifics:
https://blog.enterprisedna.co/power-bi-conditional-formatting-for-chart-visuals-whats-possible/
https://www.sqlshack.com/power-bi-conditional-formatting-and-data-colors-in-action/
these article seem to show static averages or brackets. i can define a measure for the average, but to my understanding the "Data Colors" tab only allows you to format based on a number, not a variable that i have a fomula for.
You can still make it dynamic if you define a color measure to use for the rules.
Color = IF ( [LinesReceived] > [AverageLinesReceived], 1, 2 )
Write the rule such that if [Color] = 1 then Green and [Color] = 2 then Red.
Hi @Anonymous ,
Is it possible for you to share a sample pbix with sensitive data removed ?
I can build a siimplified sample file and if you can do what i want on there, I can copy the logic onto mine. Is that an option? How would I share it?
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 32 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 38 | |
| 27 | |
| 24 |