  Let $f$ and $g$ be real-valued continuous injections defined on a non-empty
real interval $I$, and let $(X, \mathscr{L}, \lambda)$ and $(Y, \mathscr{M},
\mu)$ be probability spaces in each of which there is at least one measurable
set whose measure is strictly between $0$ and $1$.
  We say that $(f,g)$ is a $(\lambda, \mu)$-switch if, for every $\mathscr{L}
\otimes \mathscr{M}$-measurable function $h: X \times Y \to \mathbf{R}$ for
which $h[X\times Y]$ is contained in a compact subset of $I$, it holds $$
f^{-1}\!\left(\int_X f\!\left(g^{-1}\!\left(\int_Y g \circ
h\;d\mu\right)\right)d \lambda\right)\! = g^{-1}\!\left(\int_Y
g\!\left(f^{-1}\!\left(\int_X f \circ h\;d\lambda\right)\right)d \mu\right)\!,
$$ where $f^{-1}$ is the inverse of the corestriction of $f$ to $f[I]$, and
similarly for $g^{-1}$.
  We prove that this notion is well-defined, by establishing that the above
functional equation is well-posed (the equation can be interpreted as a
permutation of generalized means and raised as a problem in the theory of
decision making under uncertainty), and show that $(f,g)$ is a $(\lambda,
\mu)$-switch if and only if $f = ag + b$ for some $a,b \in \mathbf R$, $a \ne
0$.
