Equalized value including anomalous conditions from the starting month
I am looking for a way to create a table like the one below. I want to create the table on the right from the original data on the left. The conditions are -If EndMonth is blank, divide Value evenly by 6 months including the start month. -If EndMonth exists, the remaining 6 months of equally divided Value is lumped into EndMonth.
I would like to know how to achieve this in both by PowerQuery and by Dax. I would be grateful if you could tell me how to do either one of them.