If I have a table like
How would I calculate the sum of Col2 based on unique Col1 (i.e in this example sum = 9)
I have tried
and calculate(sum('table'[Col2], filter('table', distinct('table'[Col1]))))
Solved! Go to Solution.
In your data, if Col1 is a, will Col2 always be 1?
If not, you'll need to figure out some way to decide which Col2 is the correct value to use in the sum. Otherwise, you can use this:
SumByCategory = SUMX(DISTINCT(Table[Col1]),FIRSTNONBLANK(Table[Col2],[Col2]))