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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

summarize two tables

Hi,

 

I have two tables,

1. Month,  newspaper company, distribution agency,  distribution address (city),  distribution address (street name)

2. Month,  store name, customerid, customer address (city), customer address (street name)

 

I want to add  "newspaper company" and " distribution agency" to the second table, 

 

Problems:

1) Several newspaper companies distribute to the same addresses

2) Newspaper uses more than one agency and some use the same agencies

 

I tried to summarize them, but it gives me an error message that a table of multiple values was supplied where a single value was expected.

 

Can anybody help me with this?

8 REPLIES 8
Anonymous
Not applicable

@Anonymous 

Summarize is a table function used to create a Table, if you just want to move columns to another table, a column function is expected.

In this case, you should have a relationship between the tables using Month columns, so you can just use Related() to create 2 columns in Table2.

 

Column 1 = RELATED('Table1'[newspaper company])
Column 2 = RELATED('Table1'[distribution agency])

 


Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

Refer:https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

You can move the column from one table to another

New Column = maxx(filter(table2,table2[Col1]= table1[col1] && table2[Col2]= table1[col2] ),table2[required_col])
New Column = maxx(filter(table1,table1[Col1]= earlier(table1[col1]) && table1[Col1]= earlier(table1[col2]) ),table1[required_col])

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
Anonymous
Not applicable

@amitchandak 

thanks for your answer. "maxx(filter('table1...."   almost worked!

I get the newspaper column, but it only shows for one streetname one newspaper company.

But it has to show the streetname several times, in order to show all the newspaper companies.

 

streetname Anewspaper company A
streetname Anewspaper company B
streetname Anewspaper company C

 

@Anonymous Thanks for your answer, "related" does not work. error message reads, that there is no connection in this context. (I made a connection with date), I also tried "lookupvalue" before, but error shows multiple values where single value expected

@Anonymous ,

I need to try with data.Can you share sample data and sample output.

 

mark me @

Appreciate your Kudos.

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
Anonymous
Not applicable

Hi,

Please show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur 

Hi, 

I try to explain it in more detail.

I have actually three tables. 1) Newspaper distribution area, 2) customer info (address) , 3) newspaper distribution costs

 

I want to compare these tables to get the following results.

So, I thought to summarize them in one table is the easiest way.

I want to know:

1) How many customers are coming from areas with no newspaper distribution.

2) How many areas with newspaper distribution, but no customers

3) How much is the cost for each area, each newspaper, each distribution agency, cost per customer

 

customer IDCityWardNewspaper/Agencycount all customerscount areas with no customerscount of customers with no distribution
 TokyoShinjuku 9 Agency A 1 
zzzTokyoShinjuku 7Agency C1  
xxxTokyoShinjuku 10Agency B1  
yyyTokyoShinjuku 11 1 1

calculatetable is another option example.  You can filter one table by the second table based on need

 

sumx(summarize(calculatetable(TableA,DATESINPERIOD( DATE[DATE], MAX( DATE[DATE] ), -6, MONTH )),
TableA[ID] , "_active",distinctcount(TableA[ID])),_active)

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors