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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
klehar
Helper V
Helper V

Color Coding Matrix based on Average Total Value

Hi,

 

I have 2 tables

Dimension Geo which has 3 values

Geo
North America
India
China

 

 

 

Fact Escalation : which has a measure called % Esclalation measure

 

 

GeoOpp IDType
North Americaop1Escalated
North Americaop2Normal
North Americaop3Normal
North Americaop4Normal
North Americaop5Normal
Indiaop6Escalated
Indiaop7Normal
Indiaop8Escalated
Indiaop9Normal
Indiaop10Normal
Chinaop11Normal
Chinaop12Normal
Chinaop13Escalated
Chinaop14Escalated
Chinaop15Escalated

 

% esclation = 
var nr = calaculate(distinctcount(opp id), type = "Escalated")
var dr = calculate(distinctcount(oppid))

RETURN divide(nr,dr,0)

 

All I want is a matrix like this with color coding 

If value of geo < average then red else green.

klehar_0-1715782947856.png

 

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

Hi @klehar ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below to get the average value

Average = AVERAGEX(ALLSELECTED('Geo'[Geo]),[% esclation]) 

2. Create a measure as below

Conditional formatting = IF ( ROUND ( [% esclation], 2 ) < ROUND ( [Average], 2 ), "red", "green" )

3. Apply the conditional formatting on the matrix

vyiruanmsft_0-1715828152246.png

Best Regards

Community Support Team _ Rena
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
v-yiruan-msft
Community Support
Community Support

Hi @klehar ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below to get the average value

Average = AVERAGEX(ALLSELECTED('Geo'[Geo]),[% esclation]) 

2. Create a measure as below

Conditional formatting = IF ( ROUND ( [% esclation], 2 ) < ROUND ( [Average], 2 ), "red", "green" )

3. Apply the conditional formatting on the matrix

vyiruanmsft_0-1715828152246.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
klehar
Helper V
Helper V

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.