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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.