Forum Discussion

jeggen's avatar
jeggen
Helper II
6 years ago
Solved

Combining Data into Summary Table

All,

 

I'm looking for some help on how to combine some data into a summary table. The main reason is to be able to map it all out into a calendar visualization and then click on day(s) and view key activities from those days. I am looking at combining really just four fields from 2+ tables into a summary table that includes these fields, a column with the source table listed. Three of the fields would always be the same (date, client, employee), the third would vary by table but would always just be text, and the fourth field would record the source table for the summary data which I want so I can filter by activity type.

 

Here might be an example of the source tables and output table:

  • Contracts
    • Date
    • Client
    • Employee
    • Contract Amount (specific to this table)
  • Interactions
    • Date
    • Client
    • Employee
    • Summary (specific to this table)
  • Payments
    • Date
    • Client
    • Employee
    • Amounts (specifc to this table)
  • Summary Table:
    • Date
    • Client
    • Employee
    • Details (Contract Amount, Summary, Amount)
    • Source Table (values would be contracts, interactions, payments,)
  • jeggen don't know the purpose of this but here it is, add the following expression as calculated table

     

    Summary = 
    UNION (
        SELECTCOLUMNS ( Contract, "Date", Contract[Date], "Client", Contract[Client], "Employee", Contract[Employee], "Details", FORMAT ( Contract[Contract Amount], "General Number" ), "Source Table", "Contract" ),
            SELECTCOLUMNS ( Interactions, "Date", Interactions[Date], "Client", Interactions[Client], "Employee", Interactions[Employee], "Details", Interactions[Summary], "Source Table", "Interactions" ),
            SELECTCOLUMNS ( Payments, "Date", Payments[Date], "Client", Payments[Client], "Employee", Payments[Employee], "Details", FORMAT ( Payments[Amount], "General Number" ), "Source Table", "Payments" )
    ) 

     

    this is where you add the above expression

     

     

    I would💖 Kudos 🙂 if my solution helped. If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

4 Replies

    • jeggen's avatar
      jeggen
      Helper II

      Here's some sample tables in Excel: Note that all of the tables have more data than I need in the summary table, so it's not just as simple as merging all the data and also need to create the "source table" column, which tells me what the entry is.

           
      Contracts    
      DateClientEmployeeContract AmountProduct
      1/1/2020ABC IncJoe$10,000Wood
      3/1/2020XYZ IncMary$50,000Metal
      4/5/2020LMN InkSam$5,000Plastic
           
      Interactions   
      DateClientEmployeeSummaryStatus
      2/15/2020ABC IncJoeCalled to thank for orderComplete
      3/12/2020LMN IncSamCalled to ask about contractComplete
      5/15/2020123 IncMaryRemember to check on ContractPending
           
           
      Payments    
      DateClientEmployeeAmount 
      1/1/2020ABC IncJoe10,000 
      1/25/2020XYZ IncMary15,000 
           
           
           
      Summary Table   
      DateClientEmployeeDetailsSource Table
      1/1/2020ABC IncJoe10,000Payments
      1/25/2020XYZ IncMary15,000Payments
      2/15/2020ABC IncJoeCalled to thank for orderInteractions
      3/12/2020LMN IncSamCalled to ask about contractInteractions
      5/15/2020123 IncMaryRemember to check on ContractInteractions
      1/1/2020ABC IncJoe$10,000Contracts
      3/1/2020XYZ IncMary$50,000Contracts
      4/5/2020LMN InkSam$5,000Contracts
      • parry2k's avatar
        parry2k
        Super User

        jeggen don't know the purpose of this but here it is, add the following expression as calculated table

         

        Summary = 
        UNION (
            SELECTCOLUMNS ( Contract, "Date", Contract[Date], "Client", Contract[Client], "Employee", Contract[Employee], "Details", FORMAT ( Contract[Contract Amount], "General Number" ), "Source Table", "Contract" ),
                SELECTCOLUMNS ( Interactions, "Date", Interactions[Date], "Client", Interactions[Client], "Employee", Interactions[Employee], "Details", Interactions[Summary], "Source Table", "Interactions" ),
                SELECTCOLUMNS ( Payments, "Date", Payments[Date], "Client", Payments[Client], "Employee", Payments[Employee], "Details", FORMAT ( Payments[Amount], "General Number" ), "Source Table", "Payments" )
        ) 

         

        this is where you add the above expression

         

         

        I would💖 Kudos 🙂 if my solution helped. If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!