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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi community,
I would like to know how i can add a column that has the total based on two columns. In this example i have in the first column, the name of the category, the second column the number of products and in the third, the sum of each category.
Column 1 | Column 2 | Column 3 |
A | 2 | 6 |
A | 1 | 6 |
A | 3 | 6 |
B | 5 | 10 |
B | 5 | 10 |
My question will be the dax or power query of how i can add this third column
Need help , Data help and tips , Free intermediate tutorials?
Thanks,
Sebastian
Solved! Go to Solution.
Hi, @sebasplas313
Please check the following methods.
1. Dax
Column:
Column 3 =
CALCULATE (
SUM ( 'Table'[Column 2] ),
FILTER ( 'Table', [Column 1] = EARLIER ( 'Table'[Column 1] ) )
)
2. Power Query
First copy the table into table2 in the power query.
Merge table2. in the original table and expand the new column.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @sebasplas313
Please check the following methods.
1. Dax
Column:
Column 3 =
CALCULATE (
SUM ( 'Table'[Column 2] ),
FILTER ( 'Table', [Column 1] = EARLIER ( 'Table'[Column 1] ) )
)
2. Power Query
First copy the table into table2 in the power query.
Merge table2. in the original table and expand the new column.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try this DAX expression to add a new calculated column to your table:
Column 3 DAX =
CALCULATE (
SUM ( 'Table (2)'[Column 2] ),
REMOVEFILTERS ( 'Table (2)'[Column 2] )
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
User | Count |
---|---|
97 | |
78 | |
77 | |
48 | |
26 |