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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
andersbq
Frequent Visitor

Create summarized table

Hello all, 

 

I got two tables with order data (ecom/retail).  My goal is to create a summarized table (based on the email address) that looks like Table 3. Table 1 & 2 has a lot of columns, below are the matching ones. 

 

TABLE 1    
EmailNameOrder IDProduct IDOrder date
john@doe.comJohn Doe121210102020-01-01
john@doe.comJohn Doe121212122020-01-01
Jane@doe.comJane Doe121512022020-05-05
Jane@doe.comJane Doe121512072020-05-05

 

TABLE 2    
EmailNameOrder IDProduct IDOrder date
john@doe.comJohn Doe202010102020-04-01
john@doe.comJohn Doe202012122020-04-01
Jane@doe.comJane Doe204012022020-06-05
Jane@doe.comJane Doe204012032020-06-05

 

TABLE 3   
EmailNameFirst orderLatest order
john@doe.comJohn Doe2020-01-012020-04-01
Jane@doe.comJane Doe2020-05-052020-06-05

 

Would really appreciate your help on this one!

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @andersbq ,

 

You could do this in Query Editor with Merge, Append, Group by and Remove duplicates features.

5.PNG

Pbix as attached.

 

Best Regards,

Jay

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @andersbq ,

 

You could do this in Query Editor with Merge, Append, Group by and Remove duplicates features.

5.PNG

Pbix as attached.

 

Best Regards,

Jay

Awesome, works like a charm!

 

Thanks! @Anonymous 

amitchandak
Super User
Super User

@andersbq , refer if this can help

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

Try like

 

summarize(
union (
selectcolumns(Table1,"Email",Table1[Email] ,"Name",Table1[Name],"Order ID",Table1[Order ID],"Product ID",Table1[Product ID],"Order date",Table1[Order date]),
selectcolumns(Table2,"Email	Name",Table2[Email] ,"Name",Table2[Name],"Order ID",Table2[Order ID],"Product ID",Table2[Product ID],"Order date",Table2[Order date])
), [Email],[Name],"First order" ,min([Order date]),"Latest order",max([Order date]))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks! @amitchandak - but I get this error message: Cannot identify the table that contains [Order date] column.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.