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

View all the Fabric Data Days sessions on demand. View schedule

Reply
AnonymousTurtle
Regular Visitor

Numeric value of average line and conditional formating

Hi, 

 

I want to get the actual number value of the average line that I used analytics to calculate?

 

AnonymousTurtle_0-1599817634173.png

 

Is it possible to somehow get this value and use conditional formating to change the colours of a different matrix e.g. red if the row totals, is under this value, and green if over? If this is possible could someone please explain how to do this too. 

 

Thanks!

3 REPLIES 3
Anonymous
Not applicable

Hi @AnonymousTurtle ,

Please follow the below steps to achieve it, you can find the details in my sample pbix file.

1. Create a measure as below to defind the color by conditions

Conditional formatting = 
IF (
    SUM ( 'Table'[Value] )
        >= CALCULATE ( AVERAGE ( 'Table'[Value] ), ALL ( 'Table'[Type] ) ),
    "Green",
    "Red"
)​

2. Navigate to "Format" pane and choose Data colors tab. Format the data bar by Field value based on the new created measure "Conditional formatting".Numeric value of average line and conditional formating.JPG

Best Regards

Rena

 

 

amitchandak
Super User
Super User

@AnonymousTurtle , if you visual is a bar with only one measure no legend you can have bar color based on conditional formatting.

 

you can create a conditional formatting measure and use that

 

example

Color Measure =
var _avgDisc = CALCULATE([Discount %],ALL(Retail))
return switch(TRUE(),
[Discount %] <_avgDisc , "Red",
[Discount %] >_avgDisc , "Green", "Black")

 

And use that in conditional formatting with "Field value" option in first box.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AllisonKennedy
Super User
Super User

The analytics should just give a straightforward average of whichever field/measure you selected, so just use AVERAGE function in DAX to create a custom measure for average and use this measure in conditional formatting.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors