Duplication of variables in the database

I only have a single task in a single process with 44 variables, because there in the database but precisely in the act_hi_varinst table it duplicates the variables, I am assembling a panel in power bi and I want to get the variables including processes already closed and the table act_ru_variable only the running ones appear

You can take a look at the history levels - and pick the audit rather than full. by default then history will store each version of each variable as it changes throughout the process instance.
You can also set the history time to live in order to have a more regular clean up.

You can find more details in the best practices documentation.