Your dax can fix the infinity problem but it still doesnt correct the total of row. I need to calculate the total by year. I cannot use sum function for a measure. The first measure just calculate for each row and I dont know how I can aggregrate for a group.
You have to know what (and how) you want to calculate when you have many dates in the current context. If you don't know how to aggregate on the conceptual level (theory), you can't know the formula either (practice).
You have to give us the rule that produces the correct number if you have many days visible in the current context. I believe the calculation is correct on the day level or for the individual row in your UW table... You have not stated the problem in full, hence doubts.