interaction design – Extra wide tables best practices

I have a table with large (25+) amount of columns in it. Right now it looks very complex and has a horizontal scroll. I want to make it more useful for the users.

enter image description here

One solution is to group columns by area (e.g. People, Time, etc.). This breaks the scanability of the table, which is basically table’s main purpose:

enter image description here

Second solution is to have a column toggle functionality, because obviously no one works with all 25 or so columns at the same time, so letting user decide which columns he needs somewhere near the columns themselves sounds like a good practice. In this case, what is the best location for the button? Below are two solutions I came up with and I don’t particularly like any.

Above the table, inline with search:

enter image description here

Or inline with column headers (seems weird, but has more context):

enter image description here

It can be also enhanced with something like “column priority index” in order to hide the ones with low priority on smaller screens.

Third one is to conduct a user research on how people actually use the table, and maybe present it’s contents in a totally different way.

I would really appreciate any ideas, suggestions, or any other feedback on this.

Thanks

EDIT

So here’s the solution I’m currently happy with and going to user test:

enter image description here

I decomposed all columns into four groups using simple card sorting, plus an extra one for the user to create his own.