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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Conditional Format

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.

jahemmy_0-1635513579638.png

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

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.

vyalanwumsft_0-1635817959695.pngvyalanwumsft_1-1635817991835.png

The final output is shown below:

vyalanwumsft_2-1635818087288.png

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.

View solution in original post

6 REPLIES 6
v-yalanwu-msft
Community Support
Community Support

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.

vyalanwumsft_0-1635817959695.pngvyalanwumsft_1-1635817991835.png

The final output is shown below:

vyalanwumsft_2-1635818087288.png

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.

AlexisOlson
Super User
Super User

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/

Anonymous
Not applicable

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.

jaideepnema
Solution Sage
Solution Sage

Hi @Anonymous ,

Is it possible for you to share a sample pbix with sensitive data removed ?

Anonymous
Not applicable

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?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.