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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PPStar
Helper V
Helper V

Conditional Formatting on Line and stacked column chat

Hi, i have the following graph

 

The x-axis is the month and year, the Y axis is the value which is stored as a Whole Number. 

The graph when plotted looks like this. 

PPStar_0-1669714310752.png

I am using the Max of value to display on the graph as for some reason i am unable to display it any other way

 

I need to put some conditional formatting on this graph, e.g. if the Max of Value is above 50, then the that month should be Red, if under 30, then orange etc.  I also need to put a threshold on there, which will be just a line showing the threshold of 20. 

 

I cant see the option to have conditioanl formatting. Can somone please assist me?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PPStar ,

 

I created a sample pbix file(see attachment) for you base on your provided info.

1. Create a measure [color].

Color = 
var t1 =MAX('Table'[Value])
RETURN
SWITCH(
    TRUE(),
    t1 >=50, 1,
    t1 <=30, 2, 3
    )

2. Make conditional formatting on Columns field(not Lines field) .

Picture1.png

3.Conditional formatting cannot filter rows based on thresholds, and we can create a measure that shows the "year & month" that reached the threshold.

Measure = 
var _threshold=20
var _b=CALCULATE(MAX('Table'[Value]),FILTER('Table',MAX('Table'[Value])=_threshold))
return _b

vtangjiemsft_0-1669789791698.png

 

You may find the solutions in similar posts below to find it helpful.

Solved: Increasing and Decreasing trend color in line char... - Microsoft Power BI Community

Solved: Customize Column Colors in Stacked Column based on... - Microsoft Power BI Community

Line stacked column chat not updating field format... - Microsoft Power BI Community

 

Best Regards,

Neeko 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 @PPStar ,

 

I created a sample pbix file(see attachment) for you base on your provided info.

1. Create a measure [color].

Color = 
var t1 =MAX('Table'[Value])
RETURN
SWITCH(
    TRUE(),
    t1 >=50, 1,
    t1 <=30, 2, 3
    )

2. Make conditional formatting on Columns field(not Lines field) .

Picture1.png

3.Conditional formatting cannot filter rows based on thresholds, and we can create a measure that shows the "year & month" that reached the threshold.

Measure = 
var _threshold=20
var _b=CALCULATE(MAX('Table'[Value]),FILTER('Table',MAX('Table'[Value])=_threshold))
return _b

vtangjiemsft_0-1669789791698.png

 

You may find the solutions in similar posts below to find it helpful.

Solved: Increasing and Decreasing trend color in line char... - Microsoft Power BI Community

Solved: Customize Column Colors in Stacked Column based on... - Microsoft Power BI Community

Line stacked column chat not updating field format... - Microsoft Power BI Community

 

Best Regards,

Neeko 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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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