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
lennox25
Post Patron
Post Patron

Conditional Formatting- 2 Std Deviation below Average and 2 Std Deviation above Average

Hi, 

Each Column is derived from a measure. Here is my measure

Apples Percentage =
VAR TotalSales = SUM('Table 2'[Total Sales])
VAR AppleSales =
    CALCULATE(
        SUM('Table 1'[Amount]),
        'Table 1'[Category] = "Apples"
    )  
RETURN
    DIVIDE(AppleSales, TotalSales, 0)
 

I have been asked to add conditional formatting to this table in Power BI.  Can anyone help me with this please? Please see example of my sample data below from Excel.

 

lennox25_0-1731420505323.png

 

I attach my sample data - https://docs.google.com/spreadsheets/d/1IyTWtuzcQtblXIbr7Kyz8rGfK9DG0RW3/edit?usp=sharing&ouid=10762... 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lennox25 ,

Thanks for marcelsmaglhaes's reply!
And @lennox25 , you can also use DAX to achieve this.
Here is my sample data:

vjunyantmsft_0-1731484211783.png

I see that you seem to be involved in calculating 2 Std Deviation and Average, but I don't know exactly which values you are calculating for these two values, so I'll just substitute two random DAXs on my end, please replace them with the ones that you are actually using.

AverageAmount = 
CALCULATE(
    AVERAGE('Table 1'[Amount]),
    ALLEXCEPT('Table 1', 'Table 1'[Score No], 'Table 1'[Category])
)
STDEVAmount = 
CALCULATE(
    STDEV.P('Table 1'[Amount]),
    ALLEXCEPT('Table 1', 'Table 1'[Score No], 'Table 1'[Category])
)

vjunyantmsft_1-1731484426462.png

vjunyantmsft_2-1731484459462.png

And the final output is as below:

vjunyantmsft_3-1731484499015.png


Best Regards,
Dino Tao
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

2 REPLIES 2
Anonymous
Not applicable

Hi @lennox25 ,

Thanks for marcelsmaglhaes's reply!
And @lennox25 , you can also use DAX to achieve this.
Here is my sample data:

vjunyantmsft_0-1731484211783.png

I see that you seem to be involved in calculating 2 Std Deviation and Average, but I don't know exactly which values you are calculating for these two values, so I'll just substitute two random DAXs on my end, please replace them with the ones that you are actually using.

AverageAmount = 
CALCULATE(
    AVERAGE('Table 1'[Amount]),
    ALLEXCEPT('Table 1', 'Table 1'[Score No], 'Table 1'[Category])
)
STDEVAmount = 
CALCULATE(
    STDEV.P('Table 1'[Amount]),
    ALLEXCEPT('Table 1', 'Table 1'[Score No], 'Table 1'[Category])
)

vjunyantmsft_1-1731484426462.png

vjunyantmsft_2-1731484459462.png

And the final output is as below:

vjunyantmsft_3-1731484499015.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

marcelsmaglhaes
Super User
Super User

Hey @lennox25 ,

Since you have the meausre for the each percentage, add the calculated measures to your table in Power BI then:

  • Apply Conditional Formatting:

    • Select the table visual in Power BI.
    • Click the dropdown for the measure you want to apply conditional formatting to (e.g., Apples Percentage).
    • Choose Conditional Formatting > Background Color or Font Color.

  • Configure Conditional Formatting Rules:

    • In the Conditional Formatting window:
      • Set the Format by option to Rules.
      • Create rules similar to your Excel format:
        • Cell Value = 0 → Apply a specific color.
        • Below Average → Choose a color (similar to your red highlight for below average).
        • Above Average → Choose another color.

Apply the same conditional formatting logic to other columns (Pears Percentage, Oranges Percentage, etc.) using their respective measures.

Let me know if that helps!

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



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