I'm trying to implement a percent of total measure in pivot table. I succeeded in creating a measure using the below formula.

However, I want this measure to recognize global filter selections. For example, I want to show emissions share by category. But if I remove 1 or 2 values from category global filter, I'd like the total share to recalculate the share with the remaining categories.
Was anyone able to achieve this?