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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mikebi
Helper III
Helper III

format negative numbers in paranthesis from a measure

Hello,

What is the best way to format a measure to show the negative numbers in paranthesis, negative 100 is (100).

 

This is my model.

 

Thank You,

Michael

 

mikebi_0-1712840555695.png

 

2 ACCEPTED SOLUTIONS

@mikebi  please use this, it will do the job.
Formatted Sales = IF([Total Sales] < 0, "(" & FORMAT(ABS([Total Sales]), "#,##0.00") & ")", FORMAT([Total Sales], "#,##0.00"))

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

View solution in original post

@mikebi So, Dynamic format strings for measures are a preview feature that you have to turn on. Once you turn them on you can go here and choose Dynamic and paste in the format string I provided.

Greg_Deckler_0-1712847486136.png

 

The problem with doing it using FORMAT is that you turn the number into text and that is often a very bad thing if you are trying to plot the number in a line graph for example. But, if you are just displaying it in a table or matrix then it might not be so bad.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@mikebi Use this as your custom format string:

 

#,0.###############;(#,0.###############);#,0.###############


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hello, 

 

Where can I define the Custom Format String in Power BI?

 

Thank You,

 

Michael

@mikebi So, Dynamic format strings for measures are a preview feature that you have to turn on. Once you turn them on you can go here and choose Dynamic and paste in the format string I provided.

Greg_Deckler_0-1712847486136.png

 

The problem with doing it using FORMAT is that you turn the number into text and that is often a very bad thing if you are trying to plot the number in a line graph for example. But, if you are just displaying it in a table or matrix then it might not be so bad.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@mikebi  please use this, it will do the job.
Formatted Sales = IF([Total Sales] < 0, "(" & FORMAT(ABS([Total Sales]), "#,##0.00") & ")", FORMAT([Total Sales], "#,##0.00"))

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors