You did not specify which exact compact unit you had so my answers will be for the 3240 and 3260. The 3240 can take a maximum of 64GB of DDR4 3200 RAM. And as for storage 1 x 2.5" SATA SSD or 2 x M.2 2280 PCIe SSD. The 3260 can take a maximum of 64GB of DDR5 4800 RAM. And the storage is similar to the 3240, with 1 x 2.5" SATA SSD and 2 x M.2 2280 PCIe SSD.  And both have only 2 x SODIMM slots so for 32GB of RAM you would have to go with 2 x 16GB of RAM modules.
Can an HDD be added to a Precision compact workstation? And if it has only 8GB memory, does it have enough memory slots for additional 24 GB memory?
Adding an HDD and memory to a Precision compact workstation