The ATTR() function id different in that it works at the view level and ignores the underlying data. It works at the row level to test if each row is unique and has limited but important functions especially in data blending where you want to study the blended view. If you want to sum rows generated as a result of using the ATTR() function, I cannot recommend a better introduction than this blog https://www.interworks.com/blog/tcostello/2014/05/15/attr-tableaus-attribute-function-explained
I can also point to this When to Use the Attribute (ATTR) Function | Tableau Software article.
There is nothing new about using the ATTR() function; you can sum rows but should keep in mind the way the figures were generated and what they indicate.
convert it to measure. try if dimension can convertible to measure or not. Let me know. Kindly attach your workbook to work on