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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SCNCKS1
Helper I
Helper I

SUM RESULTS FROM A TABLE IN ANOTHER TABLE IN POWER BI USING 3 DIFFERENT RELATIONSHIPS

hi, i hope someone can help.

i am trying to create a calculated column that returns the sum of results from a table that is not directly related in the model.  I have used treatas, but it isn't working correctly. Also, not sure how to incorporate the greater than function for the date. in the filter. There are more columns in both tables, but the ones showing are the ones that would need to be matched to select the correct total.

 

Client Rates
rateDescriptionproduction uniteffective dateprojectid
2Description1ProductionUnit14/8/2022Project1
5Description2ProductionUnit14/8/2022Project1

 

Production
Production UnitDateprojectidClient Rate Sum
ProductionUnit1greater than or equal to C_R_Effective_DateProject17

 

Thank you!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@SCNCKS1 , if you are creating a column then you can have

new column in table2

sumx(filter(Table1, Table2[Date] > Table1[Date] && Table2[col] = table1[col]), Table1[Value])

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

Worked perfectly! Thank you!

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@SCNCKS1 , if you are creating a column then you can have

new column in table2

sumx(filter(Table1, Table2[Date] > Table1[Date] && Table2[col] = table1[col]), Table1[Value])

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Worked perfectly! Thank you!

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.