Yes, "ha det bra" is a farewell greeting in Swedish. Although I'm not sure, I can imagine the Norwegians saying it as well. The translation is more like "Have a good time" and I would not alone use it as a "goodbye" Instead I would combine it with one of the following:
*Hejdå (Goodbye)
*Tjadå (Colloquial, a compound of 'tja' (colloquial hi) and -då like the above)
*Farväl (Is an old word and sounds quite dramatic)
*Adjö (Same as above, it feels I would perhaps say these two to somebody i will never meet again)
Examples:
(Someone is leaving for a vacation)
"Hejdå, ha det så bra i ____" (Wherever they are going)
(Saying bye to a friend on the telephone)
Hejdå, ha det så bra. Vi hörs!