Forum Discussion

jimbolya's avatar
jimbolya
Regular Visitor
8 years ago
Solved

Merging Tables with Addition Function

I have two tables. They both have two columns. A category column and then a count for that category.

 

Example:
Table #1

Column 1      Column 2
Abuse            45

 

Table #2

Column 1      Column 2
Abuse           3

 

I want to join these two tables so that the category is summed.
In this example Abuse would be summed at 48.

 

Any non-matching rows would simply get their own row and count.

 

So in this example there is clearly two rows between the two tables with a category of Abuse.
However, maybe there’s a row category of ‘Antagonism’ that doesn’t have any other match. It gets its own row.

 

 

Jimbo

  • jimbolya,

     

    Try appending the two tables.

    Go to Home - Edit Queries - Append Queries - Append Queries as New.

     

    If you add the Colum 1 and Column 2 to a Table visual, it should display the summarised values.

     

    If you need to create a data table of the summarised values, you can use the SUMMARIZE() DAX function.

     

    If this solves your problem please mark as teh solution.

9 Replies

  • jimbolya

     

    I would do the following :

    1.  Append the two tables together
    2.  Group the resultant by Column 1 and calculate the sum of Column 2 
    • jimbolya's avatar
      jimbolya
      Regular Visitor

      Nope - abuse is still 45...needs to be 48 in order for me to know the operation worked...

      • NipponSahore's avatar
        NipponSahore
        Resolver II

        Should not be. Do you still see 2 Abuse after grouping the data?

  • anandav's avatar
    anandav
    Skilled Sharer

    jimbolya,

     

    Try appending the two tables.

    Go to Home - Edit Queries - Append Queries - Append Queries as New.

     

    If you add the Colum 1 and Column 2 to a Table visual, it should display the summarised values.

     

    If you need to create a data table of the summarised values, you can use the SUMMARIZE() DAX function.

     

    If this solves your problem please mark as teh solution.

    • jimbolya's avatar
      jimbolya
      Regular Visitor

      I will try this.  

      However, I've never used the SUMARIZE DAX function...

      That part will probaby not go well lol. 

       

      Jimbo