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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
lauriemclolo
Helper III
Helper III

Color for Max on Bar Chart formula not working

I'm new to power bi and I'm trying to color the min and max column in my bar chart differently from the rest of the bar chart columns.  I've looked at different options online.  None of the formulas error out, they just don't work.  This is one of the formulas I've tried.  But none of the formulas I've tried have worked 

Max_Min Color =
var v1=
maxx(ALLSELECTED(point_balance_by_member[point_bin]),calculate(COUNT(point_balance_by_member[user_id])))
var v2=
minx(ALLSELECTED(point_balance_by_member[point_bin]),calculate(COUNT(point_balance_by_member[user_id])))
return
if(count(point_balance_by_member[user_id])=v1,"Dark Blue",if(count(point_balance_by_member[user_id])=v2,"Light Blue","Green"))

lauriemclolo_1-1747964871246.png

 

 

1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

Hello @lauriemclolo 

 

Here you can go

pankajnamekar25_0-1747967680557.png

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

8 REPLIES 8
v-venuppu
Community Support
Community Support

Hi @lauriemclolo ,

As this thread is already solved, please create a new thread in the forum community.We are happy to help.

Thank you.

lauriemclolo
Helper III
Helper III

I was unable to understand why this works.  I now now have a parameter instead of a single measure that I am trying to format similarly.  Is there a way to format conditionally similarly when the measure used in the column chart is a parameter choice with a slider.  Maybe I should start another post (?)

Hi,

Share the download link of the PBI file.  Explain (in a text box) the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-venuppu
Community Support
Community Support

Hi @lauriemclolo ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Ashish_Excel @pankajnamekar25 for the prompt response.

I have created sample pbix file by using sample data to replicate the scenario.

You can find the attached .pbix file for your reference.

After creating chart , Apply Conditional Formatting

Select the chart.

In the Visualizations > Format pane, expand Columns > Colors.

Set:

Format by: Field value

Based on field: BarColor measure

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

Thank you.

 

Regretfully this had the same effect as my formula, i.e. it formatted all bars as though they were the max.  I thought possibly it was because I had the count of user id displayed "show values as percent of total" but when I returned to "no calculation" (just showing the counts and not the percent) the same result.  However pankajnamekar25 response did work.  I'm sure it's something I'm doing, so hopefully I'll get better at this.  Thank you.

Ashish_Excel
Super User
Super User

Hi,

Share the download link of the PBI file.

pankajnamekar25
Super User
Super User

Hello @lauriemclolo 

 

Here you can go

pankajnamekar25_0-1747967680557.png

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Thank you pankajnamekar25 it worked.  Though I don't understand why, since the gray is >= and <=, which is inclusive of 0 and 100, which would overlap with the next two rules, and none of the bars technically are 100% or 0%.  I'll have to do more research.  Thank you again!!!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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