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
Anonymous
Not applicable

Conditional formatting Card - Callout value - negative numbers are ignored

Hi

 

I'm having problems with formatting a datacard value conditionally. I want to have the font in red, if the number is negative and green if it's positive. Hoped it would be a simpler matter 🙂

 

Anyway, the underlying data roughly looks as follows:

 

Invoice NumberGroupChange to last Invoice
123410.005
123420.005
123430.005
98761-0.02
98761-0.02
98762-0.02

 

As you see, I have a multi-indexed table (if that's important). But the group in this specific case is of no matter, since the change refers to the invoice anyway. This is the data I get from the database and I can not normalize it further for other purposes.

 

Anyhow, I drill-through the page using an Invoice number and want one change value in the datacard. This is naturally achieved with any aggregation function since it yields the same result anyway. I'm using max in my exampe (but my problem occurs with min/max/sum/avg etc. too)

 

bckrmx_0-1668192694935.png

The "change" column in the query editor is formatted to decimal and in the data tab of the editor I formatted it further to percentage (already formatting it into percentage in the query editor doesn't change the error unfortunately)

 

I tried every possible permutation in the image above. I also tried:

  • Green
    • If value >= MIN and < 1000
    • if value >=0 and < 1000
  • Red
    • if value >= Min and <= 0
    • if value >= -1000 and <= 0

And various other possibilities, all to no avail.

As you see in the image above, I tried working with decimal points, since I thought maybe the numbers are rounded somwhere in the background. Since the original underlying data is 0.05 for 5% for example, but that didn't work either.

What makes me doubt it could be a problem with the number formatting or anything is, that the conditional formatting works when it's a table:

 

bckrmx_1-1668193334231.png

 

Any ideas? I'm really confused here.

 

Thank you very much

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

you can create a measure used for conditional formatting,  refer to 

Solved: Conditional Formatting based on calculated measure - Microsoft Power BI Community

Measure = 
var V=CALCULATE(SUM('Table'[Value]))
return IF(V>R[R Value],"#FD625E",
            IF(V>[A Value]&&V<R[R Value],"#F2C80F",
                IF(V>G[G Value]&&V<R[R Value],"#01B8AA")))

if you need more help, please share a sample file.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

you can create a measure used for conditional formatting,  refer to 

Solved: Conditional Formatting based on calculated measure - Microsoft Power BI Community

Measure = 
var V=CALCULATE(SUM('Table'[Value]))
return IF(V>R[R Value],"#FD625E",
            IF(V>[A Value]&&V<R[R Value],"#F2C80F",
                IF(V>G[G Value]&&V<R[R Value],"#01B8AA")))

if you need more help, please share a sample file.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, 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
Top Kudoed Authors