aaaa = df3.groupby("BU").apply(lambda sub: sub.pivot_table(
values=["Cost YTD",
"Forecasted Cost in Current FY",
"Plan FY",
"Variance FY"],
index=["Project ID","Name"],
fill_value=0,
aggfunc=np.sum,
margins=True,
margins_name='SubTotal').astype(int))
For some reason when I extract my pivot table to excel my value columns are not in order has instructed. How do I fix that?
Thanks,