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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Lamia
Helper I
Helper I

How to Format Currency number in Red when Negative

Hi,

Would you please help me to Format Currency number in Red when Negative. What should I add to the below

FORMAT([Measure]*VALUES(Currencies[Currency Rate]), "€ #,#"

Thanks in advance

lamia

16 REPLIES 16
PaulDBrown
Community Champion
Community Champion

@Lamia 

Why are you using the FORMAT function to convert it to currency (FORMAT converts it to type text)?

You can simply format the measure as currency using the type options for columns in the ribbon:

currency.jpg

 

This way it remains a number and you can use conditional formatting as many have already suggested.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






image.png

Because I have differents Currencies - I have a slicer where I can select local currency/USD/EUR - I need the FORMAT fuction to display the currency symbol when the corresponding currecy is selected on the slicer. Every thing is working find except that I can not color the numbers when negative

 

PaulDBrown
Community Champion
Community Champion

@Lamia 

Ok, a very good reason then!

Create a measure along the lines of:

 

Conditional format negative values = IF(CONTAINSSTRING([Currency], "-"), 1)

 

(assuming your negative values contain a "-" sign)

Now go into the Formatting pane, select the measure under Conditional Formatting, activate "font color":

format pane.JPG

 Select rules from the dropdown and follow the setting in the image below:

rules.JPGAnd you will get this:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Did not managed to have it in red with my measure - Also my reports contains many measures where numbers are negative - I would have liked to have the how to get red numbers using FORMAT fuction

Someting like below, but I d'ont know how to right it to obtain the desired result

Lamia_0-1614464795559.png

 

PaulDBrown
Community Champion
Community Champion

@Lamia 
FORMAT does not currently allow colour coding.

So how are the negative values represented in your measures? 
can you post a table with negative values?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






You are right, we can see that nothing is happening as Format does not handle color formattingYou are right, we can see that nothing is happening as Format does not handle color formatting

PaulDBrown
Community Champion
Community Champion

@Lamia 

Sorry, I'm answering from my phone, so I can't read the name of the measure you have posted to show that FORMAT doesn't colour code. 
but basically you need, as per my example above:

let's call this last measure [your measure]
to identify negative values for this measure you need:

Condit Format for your measure =IF(CONTAINSTRING([your measure], "-"), 1)

now follow the instructions in the post with the method I posted above.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






I believe that would be the only solution for me to color formatting my negative numbers - I will give a try and let you know 

Many thanks for your valuable help

 

PaulDBrown
Community Champion
Community Champion

@Lamia 

Just to be clear, you don't need to create a conditional formatting measure for  all your currency measures; only the measure your will be using in the visual. 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Tahreem24
Super User
Super User

@Lamia use the below article to set the red format when negative. 

https://www.sumproduct.com/blog/article/power-bi-tips/power-bi-blog-conditionally-formatting-negativ....

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thanks but this article is not helping as I need to use FORMAT fuction because I have a currency formated values

pranit828
Community Champion
Community Champion

Hi @Lamia 

You need to use the table chart type not Matrix and uder the conditional formatting select font color

pranit828_0-1614452898843.png

This will pop up a window and in the window choose as per below

pranit828_1-1614452943074.png

to get the desired result

pranit828_2-1614452974077.png

 

 

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Thanks but I need to use FORMAT function because I have a currency formated values

Portrek
Resolver III
Resolver III

You can do that through conditional formating.

 

look this video below, maybe this help you

 

https://www.youtube.com/watch?v=lhf2tJeiwYw&feature=emb_logo

 

Best regards.

Thanks - but still this is not really helping in my case

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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