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
David_F64
Frequent Visitor

Conditional formatting of accent bar colour in Card visual

This should be easy but I am stumped

I have a simple New Card visual with two values, each with an accent bar. I just want the bar one colour if the value is > 0, a different colour if its < 0

Now in Excel this would be simple, what am I missing in Power BI ?

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @David_F64 -If you'd like more control over the logic, you can create a measure that returns a color value based on the value of another measure

 

ColorMeasure =
IF([Total Hours per Role] > 0, "Green", "Red")
 
you can replace your measure as i am using total hours per role

 

rajendraongole1_1-1727074439059.png

 

 

In the Visualizations pane, go to Format.>>Under Card, look for Background.>>Click the fx button next to the Background color and set your rules (similar to the Data label method).

 

 

 

Hope it works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @David_F64 ,

 

If you are using a card visual, I recommend using the solution provided by @rajendraongole1 , which allows you to control color changes through measures. If this resolves your issue, please mark @rajendraongole1 's response as "Solved" to close this thread.

 

If you are considering using other visuals instead, you can achieve a similar effect by using a table visual along with conditional formatting settings.

 

vbofengmsft_1-1727419463420.png

 

 

vbofengmsft_0-1727419349962.png

 

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Kedar_Pande
Super User
Super User

@David_F64 ,

 

From the cards format pane, select the value you want to apply the accent bar color.

Kedar_Pande_0-1727421005582.png

 

Then use fx on accent bar to apply the color rule:

Kedar_Pande_1-1727421084742.png

Result:

Kedar_Pande_2-1727421117622.png

 

 

Anonymous
Not applicable

Hi @David_F64 ,

 

If you are using a card visual, I recommend using the solution provided by @rajendraongole1 , which allows you to control color changes through measures. If this resolves your issue, please mark @rajendraongole1 's response as "Solved" to close this thread.

 

If you are considering using other visuals instead, you can achieve a similar effect by using a table visual along with conditional formatting settings.

 

vbofengmsft_1-1727419463420.png

 

 

vbofengmsft_0-1727419349962.png

 

Best Regards,

Bof

rajendraongole1
Super User
Super User

Hi @David_F64 -If you'd like more control over the logic, you can create a measure that returns a color value based on the value of another measure

 

ColorMeasure =
IF([Total Hours per Role] > 0, "Green", "Red")
 
you can replace your measure as i am using total hours per role

 

rajendraongole1_1-1727074439059.png

 

 

In the Visualizations pane, go to Format.>>Under Card, look for Background.>>Click the fx button next to the Background color and set your rules (similar to the Data label method).

 

 

 

Hope it works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.