This thread shows how it is done using a parameter: Re: How to dynamic hide/unhide a column
In their solution they create a calculated field [show population] like this:
case [show Population] when "show population" then SUM([Population (count) (copy)])
when "hide population" then null
This calculated field controls the Population column: when "show population" is selected as the value of the parameter, the column is computed. Otherwise, it's set to null.
You will still see the column name when you choose names that hide it, but the values will be null.
Take a look at the example and see if you can make it serve your purpose. If you have more questions, don't hesitate to ask.
Thank you Stoyko, I will definitely check this out!