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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Alex_SD
Frequent Visitor

Custom Format Measure column to add brackets/parentheses to negative numbers

Hi all,

 

My finance department has asked that the currency columns be format from -£5,000 to (£5,000)

I've tried a few options but I can't get this to work when the column is a measure...

 

Variance =
FORMAT (
    CALCULATE (
        SUM ( Margin[Cont Margin] )
            - SUM ( Margin[Cont Budget] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Week] <= MAX ( 'Calendar'[Week] ) )
    ),
    "£#,##0;(£#,##0)"
)

The column is a calculating a cumulative variance over the weeks which needs formatting. The formatting works for any other column except a measure...

 

Any tips would be great, cheers

1 ACCEPTED SOLUTION

Do it in two steps:

 

Measure 2 = VAR myCalc = CALCULATE(100) RETURN FORMAT(myCalc,"£#,##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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

Perhaps the issue is with your calculation? I did something very simple:

 

 

Measure 2 = FORMAT(-100,"£#,##0;(£#,##0)")

This came out as: 

(£100)

Positive numbers came out as:

£100

Seemed to be right.

 



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Unfortunately this doesn't work with Calculate...

The formula for the measure works as expected, but as soon as I add the FORMAT(CALCULATE( it breaks.

 Error in TableError in Table

 

 

 

 

 

Hi,

it does work with calculate function. But just be aware that using format function converts the value into a string / text data type.

I am using this function for the measure displayed in the matrix table with the option "no calculation" and not having any problem. Unfortunately such measure cannot be used in any line or stacked columns charts.

 

Sean
Community Champion
Community Champion

@martina

You know I actually have exactly the opposite problem. The US $ defaults to showing negatives like so ($100)

 

In Excel we have better Formatting options as you know and can see in the picture

 

Currency Symbol Formatting.png

 

But I was just surpised to find out you don't even have this option in the Excel Formatting for the pound 

 

We need this option to be available for all currencies in PBI

And I hope they add it someday.....Smiley Happy

 

 

Do it in two steps:

 

Measure 2 = VAR myCalc = CALCULATE(100) RETURN FORMAT(myCalc,"£#,##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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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