Forum Discussion

vjnvinod's avatar
vjnvinod
Icon for Impactful Individual rankImpactful Individual
6 years ago
Solved

change number to abs value using a filter condition

Hi,

 

Can you help me with a measure,

basically i need to convert any negative numbers in my coloumn(ActualChrdHours) to positive number if my coloumn(ReverseVsMercurry) is "Not a reverse".

 

can you help?

 

 

 

  • HI vjnvinod ,

     

    Your Switch column has created in different table than where yours Reverse and ActualChrdHours fields are coming. I suggest you to Right click on your DataDumpFull(2) Table at right side of Pane then click on create a New COlumn option.

15 Replies

  • Hi vjnvinod ,

     

    Please give a try to below Measure:

    Measure = ABS(CALCULATE(SUM('Table'[ActualChrdHour]),'Table'[ReverseVsMercurry]="Not a reverse"))
     
    Please give Kudos and accept it as a solution if it helps you!
    • vjnvinod's avatar
      vjnvinod
      Icon for Impactful Individual rankImpactful Individual

      Tahreem24 

       

      can you add one more condition into it

       

      if its reverse, make my actuals negative

      • Tahreem24's avatar
        Tahreem24
        Icon for Super User rankSuper User

        Hi vjnvinod ,

        You can use the below Measure for your new requirement.

         

        Measure 2 = if(sum('Table'[ActualChrdHour])<0,(ABS(CALCULATE(SUM('Table'[ActualChrdHour]),'Table'[ReverseVsMercurry]="Not a reverse"))),sum('Table'[ActualChrdHour]))
         
        I expect Kudos to my previous answer 😊 and this answer as well. And Please Accept this as a solution.