Forum Discussion

IF's avatar
IF
Post Prodigy
6 years ago
Solved

negative value in bracket

Hi,

I have a column that is called "project". its format is decimal number. I want to show negative values with brackets. I tried to make a measure (Measure=FORMAT([Project];"##,###;(##,###);-")

The PowerBI highlights under Project as if it doesn't recognize it. What should I do?

 

Best,

  • IF ,

    What is [Project] exactly? Is it Measure or just a fields or Calculated column?

    If it is field from table so try to use aggreagation like SUM,MAX etc.

     

  • IF ,

    Use the below DAX:

    MEASURE = IF(SUM(Sheet6[Value])<0,"("& SUM(Sheet6[Value])&")", SUM(Sheet6[Value]))
     

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    IF 

     

    So you have to turn your column PROJECT into a measure. There are too many values, so you need to use MAX/MIN/SUM/etc. to tell the measure what specific value to turn into that format.

     

    You will need two measures, for example:

     

    Measure1 = MAX(Table[Project])

     

    Measure2 = FORMAT( [Measure1], "###,###; (###,###); -")

     

    (make sure to use more # if your numbers go into the millions i.e. "#,###,###; (#,###,###); -"

    • IF's avatar
      IF
      Post Prodigy

      Hi,

      Thanks it works,  but the total gives wrong sum. How can I display correct sum?

       

      Best regards,

    • Tahreem24's avatar
      Tahreem24
      Super User

      Or you can also try using Dax:

      = IF([Project]<0,&"("& [Project]&")", [Project])

       

      • IF's avatar
        IF
        Post Prodigy

        Hi,

        When I type [Project], the power bi doesn't recognize it. it underlines it with red unfortunatelly.