It’s quite difficult to work this out without seeing an example because this is quite a unique way that you’ve gone about solving this.
Have you tried maybe just splitting the column. Because you could split that column and retrieve the number of days, then with that number of days all you need to do is add that onto the invoice date and then you theoretically would have your due date.
I wouldn’t get too fancy here around working out the exact M code to solve this. You should just be able to use point-and-click to work through finding a solution for this.
Give this a go and see if I get you we need.