Reputation: 35
I am new to DAX, I have a data which looks like -
col1 | col2 |
---|---|
A | 20 |
A | 10 |
B | 30 |
B | 20 |
My output should be -
col1 | col2 | col3 |
---|---|---|
A | 20 | 30 |
A | 10 | 30 |
B | 30 | 50 |
B | 20 | 50 |
I have tried writing a measure but it dosnt work -
col3 =
CALCULATE (
SUM ( Sheet1[col2] ),
FILTER (
ALLSELECTED ( Sheet1 ),
Sheet1[col1] == Sheet1[col1]
)
)
Upvotes: 0
Views: 116
Reputation: 12295
If you are actually looking for a formula to calculate col3, take this one here and put all cols into a table visual.
col3 =
CALCULATE(
SUM('Sheet1'[col2]),
ALLEXCEPT(
'Sheet1',
'Sheet1'[col1]
)
)
Upvotes: 2