Forum Discussion
Divide two columns DAX
- 8 years ago
Anonymous
I think you should create a MEASURE instead of Calculated Column
LEADTIME =
Sum(aWORKFLOWWORKITEMTABLE[DIFFERENCEINDAYSV2]) / sum(aWORKFLOWWORKITEMTABLE[COUNTRECID])
I believe...With a calculated column, division occurs first and then the results are summed in a Table Visual. Thats why it gives you inaccurate results
Can you share some example raw data so that we can recreate what is going on here?
- sgsukumaran8 years agoResolver II
Your calcualtion should be
LEADTIME =
aWORKFLOWWORKITEMTABLE[COUNTRECID]/aWORKFLOWWORKITEMTABLE[DIFFERENCEINDAYSV2]
- sgsukumaran8 years agoResolver II
or Use Divide(aWORKFLOWWORKITEMTABLE[DIFFERENCEINDAYSV2] , aWORKFLOWWORKITEMTABLE[COUNTRECID)
- Anonymous8 years agoNot applicable
Hello ,
as you can see the total of these three columns is correct because 28172 / 566 = 49.77. The issue is that the expected result for each rows doesnt work. on the first row i expected 46.57 and not 8.80.
How can i divide each rows in the good way between column DIFFERENCEINDAYSV2 and ACTIVITYID?
- Zubair_Muhammad8 years agoCommunity Champion
Anonymous
I think you should create a MEASURE instead of Calculated Column
LEADTIME =
Sum(aWORKFLOWWORKITEMTABLE[DIFFERENCEINDAYSV2]) / sum(aWORKFLOWWORKITEMTABLE[COUNTRECID])
I believe...With a calculated column, division occurs first and then the results are summed in a Table Visual. Thats why it gives you inaccurate results