Using EXPAND and COLLAPSE in visual calculations

See when EXPAND and COLLAPSE are required to obtain the correct result with visual calculations in Power BI.