How to show the sum of non-selected categories grouped together as “Other” category in visuals

I recently came across an interesting problem regarding how you can show the sum of values of certain selected categories as separate bars in a bar chart - but with the sum of all the non-selected categories being grouped together…