Yes you can use a calculated attribute for this: https://docs.mendix.com/refguide/attributes/
However the use of this is discouraged due to performance reasons, see https://docs.mendix.com/refguide/performance-best-practices/
Often it is best to pre-calculated the value or calculate the value on display with a datasource microflow or microflow button depending on your case.
Hope this helps!
I think your best option would be creating an entity called Attribute with a 'Key’ and 'Value’ attribute.
You can extend this with more attributes or entities to create a more complex system of dynamic attributes (which enables the use of dynamic enumerations etc).
Hope this helps!