Forum Discussion
formula sum vs table sum
hi rosefei
i could not to repeat your data model, but it looks like task for SUMX() function, like
TargetIndex = SUMX('Table',CALCULATE(SUM([BelowTargetDepth]))*CALCULATE(COUNT([SubCategoryID])) )
- rosefei6 years ago
Microsoft Employee
Very interesting! I think we are close. Still have a small prob.
Now the targetIndex in each row is not doing the multiplication any more. I think this is because the underlying table is on subcategory level, the SUMX is only doing on row level sun, which means the count(subcategroyID) is always 1.
I tried a few different combination but still not getting the right answer...
- Anonymous6 years agoNot applicable
in sumx if you want to multiply column with total count you need to use all.
COunt measure=calculate(count(table[Column]),all(table[Column]))
Then use it in sumx.
SumX(table,table[Col1]*[Count measure])
Refer microsoft documentation
https://docs.microsoft.com/en-us/dax/all-function-dax
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.- rosefei6 years ago
Microsoft Employee
Thank you for your input, I tried to respond multiple times but the website kept crashing.
Unfortunately this did not solve my prob.