Total Amortized cost, year_month and Company are not computed but part of the original data set. I will share the computation for direct cost as below -
Company Category = ifelse(isNull(Company),‘Null’,ifelse(Company<>‘ABC Corp’,‘Customer’,‘Central’))
Direct cost = sumOver(sum({total_amortized_cost}),[{Company Category},{year_month}])
Direct Cost% = sumif({total_amortized_cost},{Company Category}=‘Customer’)/({Direct cost })