Optimizing SWITCH on slicer selection with Group By Columns

Optimize the query performance of a SWITCH function in DAX that reads a slicer selection: the Group By Columns property can solve a practical problem.