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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Conditional Formatting in Matrix using the Mean of a Column

I have a Measure called [Cascata Acumulado Rec sobre Total] that is a calculated measure, it shows the acumulated percentage in the Safra variable for the current Month (NOTE: I can`t calculate AVERAGE() of this measure)

In the image below you can see the matrix

augustodarruda1_0-1702313884243.png

I want to paint the background of the cell RED if the value is below the AVERAGE of that Month

So this is what i want to have

augustodarruda1_1-1702314106592.png


I've tried several approaches, but I couldnt figure it out, I know that my conditional formatting measure is something like this:

Color =
VAR ValorAtual = [Cascata Acumulado Rec sobre Total]
VAR AvgMonth = [Medida MediaMes]
RETURN
IF(
    ValorAtual < AvgMonth,
    "Red",
    "White"
)

The thing is, I need to kind of lock the Average just to calculate the AVERAGE of the month, so i can have something like this

augustodarruda1_2-1702314791173.png

 

So that i can calculate my Conditional Formatting Measure to us in my matrix
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Below is my table:

vxiandatmsft_0-1702434682546.png

The following DAXmight work for you:

Column = 
   IF('Table'[Cascata Acumulado Rec Sobre Total]<'Table'[Average_Measure] , 1,0)

The final output is shown in the following figure:

vxiandatmsft_1-1702434727884.png

vxiandatmsft_2-1702434755213.png

Best Regards,

Xianda Tang

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

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

Below is my table:

vxiandatmsft_0-1702434682546.png

The following DAXmight work for you:

Column = 
   IF('Table'[Cascata Acumulado Rec Sobre Total]<'Table'[Average_Measure] , 1,0)

The final output is shown in the following figure:

vxiandatmsft_1-1702434727884.png

vxiandatmsft_2-1702434755213.png

Best Regards,

Xianda Tang

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric Community.