Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I want to sum values by unique ID, and then add another value from a different table to those sums (based on the same unique ID) to create a new column in a table or create a new measure.
I'm not sure if it's possible to append queries to create a new table or if the better solution is DAX but, frankly, I'm new to both approaches so I'm not sure what options are available or which is the most elegant solution.
Below are some tables representative of the scenario. The data is imported into the dataset.
Table 1.
| ID | REF | ValueA |
| 252 | 555 | 1000 |
| 261 | 560 | 1500 |
| 300 | 562 | 1350 |
| 324 | 578 | 2000 |
| ... | ... | ... |
| ... | ... | ... |
Table 2.
| Index | ID | ValueB |
| 1 | 252 | 100 |
| 2 | 252 | 150 |
| 3 | 261 | 500 |
| 4 | 300 | 100 |
| 5 | 324 | 150 |
| 6 | 324 | 150 |
| ... | ... | ... |
| ... | ... | ... |
Effectively, I want to:
The objective is to create a new Field in Table 1 called NewValue such that Table 1 would look like:
Table 1.
| ID | REF | ValueA | NewValue |
| 252 | 555 | 1000 | 1250 |
| 261 | 560 | 1500 | 2000 |
| 300 | 562 | 1350 | 1450 |
| 324 | 578 | 2000 | 2300 |
| ... | ... | ... | |
| ... | ... | ... |
Solved! Go to Solution.
Just now, I've tried:
Table = SUMMARIZE(Table2,Table2[ID],"ValueC",SUM(Table2[ValueB]),"ValueA",SUMMARIZE(Table1,Table1[ValueA]))
To create a new table, and then simple added a column in the table by adding the two columns together.
The added NewValue can then be referenced elsewhere.
Just now, I've tried:
Table = SUMMARIZE(Table2,Table2[ID],"ValueC",SUM(Table2[ValueB]),"ValueA",SUMMARIZE(Table1,Table1[ValueA]))
To create a new table, and then simple added a column in the table by adding the two columns together.
The added NewValue can then be referenced elsewhere.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 65 | |
| 43 | |
| 41 | |
| 32 | |
| 23 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 71 | |
| 54 |