You always use your profile stat when determining your attacks. You may recieve a bonus close combat attack for wielding a pistol and close combat weapon. This bonus does not apply to : power fists, lighting claws, and armies individual instances of such weapons. These weapons may gain an additional attack if a model is wielding a pair of these weapons. Also, you must decided at the beinging of combat which weapon you are using for that combat. So, you can not swing once with a power sword and then swing later with a power fist.
Most models don't even give you the option to equip the character like that, some special characters have wierd gear like that. But, that is an instance when you have to declare what you are fighting with.