Forum Discussion

angelikamariae's avatar
6 years ago
Solved

Matrix, operations between columns

Hello

I have created a column which holds the Marging as a result of the substraction of ActualSales-ActualCost column. 

What you see in the picture is the values of a matrix.  If you see in bolds what shows there is the min of the margin.  I would like it to show actually the value (for ex 0-8370.92=8370.92) and not -1483.20 which is the min value of it in the tree.

I checked the options but I have otheres like max, average etc.  I just want the real value of the substraction there...

is this possible? in the worst of the cases I dont want to show anything in that column for the bolds section. Could some one advice? 

 

 

Thanks

Angelica.

  • angelikamariae's avatar
    angelikamariae
    6 years ago

    ok I got it!

    I just chose "Sum" instead of min and it did what I wanted.

    thanks for your help.

     

    Angelica.

5 Replies

  • VasTg's avatar
    VasTg
    Memorable Member

    angelikamariae 

     

    You should use ABS()..

     

    Measure = 
    VAR MARGIN =ActualSales-ActualCost
    RETURN ABS(MIN(MARGIN))

     

    If it helps, mark it as a solution

    Kudos are nice too

    • angelikamariae's avatar
      angelikamariae
      Helper I

      HI Super User

      Your function seems to return the abs value of Margin.  My problem is not about the positive or negative sigh, but the value itself. I dont want the min or max value of the substraction in the tree, I want the substraction result.

       

      Anyways I tried the solution you gave me but I am getting this message:

       

      The MIN function only accepts a column reference as an argument.

       

      I even tried to do this:

       

      Measure =
      VAR MARGIN =[ActualSales]-[ActualCost]
      RETURN ABS(MIN(MARGIN))
       
      and still the same message.
       
      Angelica
  • I doubt something to do with the row context. Can you share the formula

    • angelikamariae's avatar
      angelikamariae
      Helper I

      Hi Amitchandak

      the formula for the Margin column is as simple as Margin=[ActualSales-ActualCost]

       

      Thanks.

       

      Angelica.

      • angelikamariae's avatar
        angelikamariae
        Helper I

        ok I got it!

        I just chose "Sum" instead of min and it did what I wanted.

        thanks for your help.

         

        Angelica.