'By the way' is used for saying that a remark is not relevant to the main subject of your conversation.
'Anyway' is used:
1. to confirm or support a point or idea just mentioned.
2. in questions to emphasize the speaker's wish to obtain the truth.
3. to end a conversation, to change the subject, or to resume a subject after interruption.