Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have two related tables
Table1
| ID | VALUE |
| 1 | 1900 |
| 2 | 50000 |
| 3 | 1000 |
Table2
| ID | QUANTITY |
| 1 | 4 |
| 1 | 5 |
| 1 | 2 |
| 2 | 12 |
| 2 | 1 |
| 1 | 56 |
| 2 | 2 |
I'm looking to create a calculated column (a measure won't do) in Table 1 to show the sum of quantity from Table 2, for each of the IDs.
Please help
Solved! Go to Solution.
Hi, @Anonymous
Please check the below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, @Anonymous
Please check the below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
works like a charm 🙂 Thansk !
@Anonymous
Add the following column:
qty table2 =
var __ table1[id] return
CALCULATE(
SUM(Table2[quantity]),
Table2[id] = table1[id]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks for the reply. I get this error when applying your dax:
The expression contains columns from multiple tables, but only columns from a single table can be used in a True/False expression that is used as a table filter expression.
Also, what is the variable for?
@Anonymous ,
new column in table 1
sumx(relatedtable(Table2), Table2[Qty])
or
sumx(filter(Table2, Table2[ID] = Table1[ID]), Table2[Qty])
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.