It's not exactly an idiom, it's a phrase from an old (1980s) Swedish humour programme. It's about two chefs, and if they lacked an ingredient, then they said "det går lika bra med selleri", selleri can replace (almost) everything. See: Werner och Werner – Wikipedia
You can find clips on YouTube.