Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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 |
---|---|
89 | |
85 | |
66 | |
62 | |
57 |
User | Count |
---|---|
138 | |
112 | |
94 | |
82 | |
71 |