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

Summarize and add column to another table

I have the first table like this

1.PNG

 

second table

2.PNG

I want the second table to be grouped by Customer and add it's paid_amount to first table as column

 

as below

3.PNG

 

Thank you

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , A new column in first table

if they are realted ,

sumx(relatedtable(second), second[paid amount])

 

if not

sumx(filter(second, first[cutomer] =second[customer]), second[paid amount])

 

refer: https://www.youtube.com/watch?v=czNHt7UXIe8

 

Power query merge can also help : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

View solution in original post

4 REPLIES 4
Tahreem24
Super User
Super User

@Anonymous ,

I replicated your sample at my side and got the expected result.  Attaching PBIX file for your reference.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

@Anonymous , If your both table connected properly with each other based on Customer Column so you dont need anything. Just drag all three columns in the single table visual.

You can see below two screen shots:

Capture.PNG1.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , A new column in first table

if they are realted ,

sumx(relatedtable(second), second[paid amount])

 

if not

sumx(filter(second, first[cutomer] =second[customer]), second[paid amount])

 

refer: https://www.youtube.com/watch?v=czNHt7UXIe8

 

Power query merge can also help : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Anonymous
Not applicable

@amitchandak 

Thank you for reply.

sumx(filter(second, first[cutomer] =second[customer]), second[paid amount]) I have used this one since tables are not related. Is that possible to add another date filter to second table like ,

second[Date] = eomonth(today(),-1)+1 ?

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.