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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SteveIOW
Helper II
Helper II

Conditional format a bar chart over 75th Quartile

Hi All,

 

I have a bar chart in which I want to colour the bars of the chart for all the values over the 75th quartile.

 

any ideas please?

 

the quartile I am calculating as VAR _A =
SUMMARIZE (
'MainFacts',
'MainFacts'[ProvCode],
'MainFacts'[p_spell_id],
"MaxRwCnt", MAX ( MainFacts[RwCnt] )
)
RETURN
PERCENTILEX.INC ( _A, [MaxRwCnt], .75 )

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

Hi @SteveIOW ,

According to your description, I create a sample.

vkalyjmsft_0-1660631747692.png

And create a measure as you mentioned.

vkalyjmsft_1-1660631786605.png

vkalyjmsft_2-1660631903095.png

Now for example in the bar chart RwCnt by p_spell_id, if we want to color the bar based on whether the RwCnt greater than the Quartile 7.25. Here's my solution.

1. Create a measure.

 

Color =
IF (
    MAX ( 'MainFacts'[RwCnt] ) >= CALCULATE ( [Quartile], ALL ( 'MainFacts' ) ),
    "Red",
    "Green"
)

 

Then in the visual format setting pane, select Bars>Colors>fx.

vkalyjmsft_3-1660632745403.png

Select the measure in the field dialoge.

vkalyjmsft_4-1660632813702.png

Get the correct result.

vkalyjmsft_5-1660632922140.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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-yanjiang-msft
Community Support
Community Support

Hi @SteveIOW ,

According to your description, I create a sample.

vkalyjmsft_0-1660631747692.png

And create a measure as you mentioned.

vkalyjmsft_1-1660631786605.png

vkalyjmsft_2-1660631903095.png

Now for example in the bar chart RwCnt by p_spell_id, if we want to color the bar based on whether the RwCnt greater than the Quartile 7.25. Here's my solution.

1. Create a measure.

 

Color =
IF (
    MAX ( 'MainFacts'[RwCnt] ) >= CALCULATE ( [Quartile], ALL ( 'MainFacts' ) ),
    "Red",
    "Green"
)

 

Then in the visual format setting pane, select Bars>Colors>fx.

vkalyjmsft_3-1660632745403.png

Select the measure in the field dialoge.

vkalyjmsft_4-1660632813702.png

Get the correct result.

vkalyjmsft_5-1660632922140.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

that is brilliant - thank you so much for your help!

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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