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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Do Multi-row Card viz Bar Color rules work?

I have these rules on this multi-line card.  I want the Active lines to have a Green bar and i want the Expired lines to have red.

SeaIT_0-1633053922174.png

As you can see they are all red despite the values.  The zero/one on the right-most column is the value the rule is assessing.

Shouldn't this work?  Thanks for any pointers.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Anonymous I just ran into this problem recently on the conditional formatting for Axis colours - it doesn't work within the visual, but rather looks at the value of the measure OUTSIDE the context of the visual, so it's looking at the SUM of the measure across the entire data model, which is not zero. 

 

Unfortunately NO, the bar colour conditional formatting doesn't work as you want/expect.

 

Try adding a filter to your page and filter for one of the lines where the Expired measure = 0, and you'll see all the bars turn green. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

@Anonymous I just ran into this problem recently on the conditional formatting for Axis colours - it doesn't work within the visual, but rather looks at the value of the measure OUTSIDE the context of the visual, so it's looking at the SUM of the measure across the entire data model, which is not zero. 

 

Unfortunately NO, the bar colour conditional formatting doesn't work as you want/expect.

 

Try adding a filter to your page and filter for one of the lines where the Expired measure = 0, and you'll see all the bars turn green. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Thank you @AllisonKennedy  How odd to allow a function to control the color, but then set the context for the formatting outside the vis.  

@Anonymous  You're welcome, and yes I thought so too. I'm sure we're not the only ones who have been tricked by this!


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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