Forum Discussion

RamaKrishna8989's avatar
3 years ago
Solved

Issue with SUMX function

Hi,

I used sumx, hence i supposed to get sum of sales and extended amounts in last coulmn. However, i seeing something else. Can someone help on it. Thanks.

 

add measure = sumx(FactInternetSales, FactInternetSales[SalesAmount] + FactInternetSales[ExtendedAmount])
  • Hello!

    I see that you are adding the data using FactInternetSales as context, which means that it will go row by row in that table doing the operation you indicated, to see that result modifies the type of summarization that the columns of ImporteVentas and ExtendedAmount have

  • Syndicate_Admin's avatar
    Syndicate_Admin
    3 years ago

    Hello, it is the same as I explain, everything depends on the filter context, when you remove the Sales order number everything is damaged because you removed the context from the matrix and therefore it is adding the data, basically it is adding all the 2.9 and it is adding them. This happens because you are directly using the columns with the measurements without a correct filter context.

    If this post is helpful in helping you solve your problem, consider giving the post a thumbs up

    and accept it as a solution!

7 Replies

  • Hello!

    I see that you are adding the data using FactInternetSales as context, which means that it will go row by row in that table doing the operation you indicated, to see that result modifies the type of summarization that the columns of ImporteVentas and ExtendedAmount have

    • RamaKrishna8989's avatar
      RamaKrishna8989
      Helper I

      Hey,

      I already selected don't summarize only. yet i am still seeing incorrect values.

       

       

  • Hi,

    as you can see there is nothing wrong in your measure

    it is only grouping all sales with the same amount.

     

    If this post is useful to help you to solve your issue consider giving the post a thumbs up 

     and accepting it as a solution !

    • RamaKrishna8989's avatar
      RamaKrishna8989
      Helper I

      Hey, if my query is correct. can you pls me understand why am i seeing huge values in add measure column, while you are getting the correct 4.58 values in add measure? 

      • Syndicate_Admin's avatar
        Syndicate_Admin
        Administrator

        Hello, it is the same as I explain, everything depends on the filter context, when you remove the Sales order number everything is damaged because you removed the context from the matrix and therefore it is adding the data, basically it is adding all the 2.9 and it is adding them. This happens because you are directly using the columns with the measurements without a correct filter context.

        If this post is helpful in helping you solve your problem, consider giving the post a thumbs up

        and accept it as a solution!