Forum Discussion

brinky's avatar
brinky
Helper IV
7 years ago

sum in table by source

Hello, 

I'm trying to get total sales by code and source from the following table, but for some reason I'm getting totals all same, any idea how to solve?

 

5 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi brinky 

    Is the sum column in the same table as? 
    Is it a Measure or Column that you are trying to create?

    if so try to use CALCULATE( SUM( YourTable[SumColumn] ) )

    If not, please can you provide extra info about your model.

     

    Regards,
    Mariusz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • brinky's avatar
      brinky
      Helper IV

      Hi Mariusz ,

       

      Thanks for your prompt reply.

      Would like to create a measure,  did try CALCULATE(SUM('retail_group grp_sales'[quantity])) did get same result.

      Might be as quantity is coming fom another table.

       

       

      • Mariusz's avatar
        Mariusz
        Community Champion

        Hi brinky 

         

        You need to change the cross filter direction on the relationship between Wine and Code to Both, like below.

         

         

        Regards,
        Mariusz

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.