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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
swolfe2
Helper I
Helper I

Dynamic Measure Formatting Negative Values with Parentheses Instead of (-)

I am attempting to do some dynamic measure formatting on a DAX measure. However, I'm having difficulty getting negative values to display with parentheses instead of the negative symbol.

For example, if I have a value of -132,500,000, I want to display it as ($132) M. 

The dynamic measure formatting is working great for positive numbers, I'm just unsure how to get it to display correctly with negative values.

VAR CurrentValue = SELECTEDMEASURE()
RETURN
    SWITCH (
        TRUE(),
        CurrentValue <= -1000000, "($#,0,,.) M",
        CurrentValue > -1000000 && CurrentValue < 0, "($#,##0)",
        CurrentValue >= 0 && CurrentValue < 1000000, "$#,##0",
        CurrentValue >= 1000000, "$#,0,,. M"
    )

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @swolfe2 

I would recommend this:

VAR CurrentValue = SELECTEDMEASURE()
VAR AbsValue = ABS ( CurrentValue )
RETURN
    IF (
        AbsValue >= 1000000,
        "$#,0,,. M;($#,0,,.) M",
        "$#,##0;($#,##0)"
    )

This makes use of the "<positive format>;<negative format>" structure.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @swolfe2 

I would recommend this:

VAR CurrentValue = SELECTEDMEASURE()
VAR AbsValue = ABS ( CurrentValue )
RETURN
    IF (
        AbsValue >= 1000000,
        "$#,0,,. M;($#,0,,.) M",
        "$#,##0;($#,##0)"
    )

This makes use of the "<positive format>;<negative format>" structure.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Worked perfectly, and is an elegant solution. Thanks so much!

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.