When you do calculation in the measures such as MAX, Power BI will perform the same calculation for the total as well. Therefore, you may see the measure total isn’t what you want. When you encounter such kind of situation, you need modify the result of measure total by using some functions like IF, HASONEVALUE, HASONEFILTER etc..
Here are the blogs that you can refer. You can modify your dax by following them.