What part of the calculation are you having the most trouble recreating and what parts need to be dynamic? Specifically I’m not sure what you mean here:
The workaround I see the most for this issue is creating the calculation in SQL before ingestion to QuickSight. Example: