Hope you are well. I have added another level (Vendor) to the previous spreadsheet.
The logic is if the Distinct Manager per State-Vendor = 1 then #Min BU per Manager-Vendor else Allocation Business Unit. I followed your code and it is working fine with my requirement. It can calculate the Header BU as I desired. However, when the data loads it is generating error and I have no clue why it happens.
If I don't load the data and create only connection and use a pivot to get the connection, I don't se any error. It only occurs if
If you can please take a look and advise how to get rid of it, would be great.