Firstly, I think it's important to recognise that these are two very different sounds. To my ear it sounds like one is a bit of vintage hardware while the other is possibly a software synth.
For the Daft Punk track, what I think I'm hearing is a TB303 set to Saw wave with a mid level resonance, fairly low cut-off frequency and run through a little bit of overdrive (most likely a valve driver knowing Daft Punk) - your best bet is to find a TB303-based vst and a valve amp simulator and figure out the settings from there.
The Avicii track is much more difficult to figure out. This things you have to take into consideration here are A) that it was probably a much brighter sound that's been pushed down using EQ so that it doesn't fight for space with some of the other sounds in the mix, B) that there's a good amount of compression on the bass sound and drums to make them pump a little, and C) that theres probably a lot of compression on the whole mix - I think those are probably the things you're missing when you're trying to rebuild these sounds yourself.