I have a number of values that are a proportion of a total and I am expressing them as a percentage (in the print composer legend):
round(aggregate(layer:='Dwelling_Other',aggregate:='count', expression:="Cons_Yr", filter:=("Locality" IN ('Archies Creek') AND "Cons_Yr" >= 1801 AND "Cons_Yr" <= 1900))/aggregate(layer:='Dwelling_Other',aggregate:='count', expression:="Cons_Yr", filter:=("Locality" IN ('Archies Creek') AND "Cons_Yr" >= 1801))*100)
but the totals add up to over 100% (in this case 102). Is it possible to use the round expression in a way that the percentages will be rounded to integers but still sum correctly to 100%? (along the lines of paxdiablo's explanation here https://stackoverflow.com/questions/13483430/how-to-make-rounded-percentages-add-up-to-100)