Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jeggen
Helper I
Helper I

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,)
1 ACCEPTED SOLUTION

@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

 

image.png

 

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!

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@jeggen paste some sample data and expected output. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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

@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

 

image.png

 

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!

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Purpose is to integrate a couple of different tables into a high level summary and include them all in a calendar view. This worked perfect!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.