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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Number format Text as colour Red

Hi Experts

 

is there a new feature in Power Bi where you can add the RBG Colour code to the measure? I am trying to make all my negative value as red, but the data is in text as using format.....

 

Not sure how to get around this

FORMAT('FACT Past Dues'[Value],"0.0;(0.0) pts"), FORMAT('FACT Past Dues'[Value], "0.0;(0.0)")))
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create color measure on you measure

if Value is a measure 

if('FACT Past Dues'[Value] < 0 "red" , "Green")

 

if Value is a column 

if(sum('FACT Past Dues'[Value]) < 0 "red" , "Green")

 

use that in conditional formatting font ->advance -> Field value

 

for steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://www.youtube.com/watch?v=RqBb5eBf_I4

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

As far as i know,RBG Colour code cannot add to measures.

To fix the problem, use hex codes(for example, #ABCDEF) or colors from the CSS supported list of colors

 

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

 

amitchandak
Super User
Super User

@Anonymous , Create color measure on you measure

if Value is a measure 

if('FACT Past Dues'[Value] < 0 "red" , "Green")

 

if Value is a column 

if(sum('FACT Past Dues'[Value]) < 0 "red" , "Green")

 

use that in conditional formatting font ->advance -> Field value

 

for steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
https://www.youtube.com/watch?v=RqBb5eBf_I4

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.