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
saraelaine
New Member

Merging two unrelated tables with repeating data.

I'm having a problem creating a solution to a problem. I want to be able to report on total sales by sales lead. I have two files with different sales type (new customer/existing customer) both reports have the sales lead multiple times as the sales lead might have made multiple sales and each sale gets it's own data row complete with the value of the sales lead. I want to be able to slice my report by sales lead by both types of sale and see them combined My data sets look like Old Customer Sales Lead total sale date of sale Customer Name Tony $1,500 10/1/2017 X Susan $1,200 6/27/2016 Y Brian $1,600 12/11/2016 Z Tony $1,350 4/6/2017 A Susan $950 2/23/2017 C Brian $2,000 3/20/2015 B Cindy $4,000 10/1/2017 Z New Customer Sales Lead total sale date of sale Customer Name Tony $500 10/1/2017 1 Susan $250 6/27/2016 3 Brian $1,750 12/11/2016 2 Tony $50 4/6/2017 1 Susan $1,900 2/23/2017 2 Brian $1,900 3/20/2015 2 Cindy $100 10/1/2017 9
1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@saraelaine

 

In this scenario, if you just want to combine two dataset without repeating rows. You can append two queries together first, then use SUMMARIZE() function to group rows into a new table.

 

0.PNG

 

=SUMMARIZE(Table,Table[SalesLead],Table[CustomerName],Table[DateOfSale],"Total Sale",SUM(Table[Sale]))

Regards,

 

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@saraelaine

 

In this scenario, if you just want to combine two dataset without repeating rows. You can append two queries together first, then use SUMMARIZE() function to group rows into a new table.

 

0.PNG

 

=SUMMARIZE(Table,Table[SalesLead],Table[CustomerName],Table[DateOfSale],"Total Sale",SUM(Table[Sale]))

Regards,

 

Thank you! That worked. 

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.