To do this, simply right-click on your desktop, select the Group Stacks By option and then select how you want stacks to stack the files and shortcuts on your desktop. You can even right-click on a stack and apply the same set of filters to files within it.