Not sure what you mean here?
The number which is returned is totally wrong whereas my values are true
Can you share a sample? One thing I would recommend it to cautiously use DISTINCT with Sum. It may not do what you think it might be doing. But without knowing much, I am not sure what your issue might be