0

I have a pivot table with several referral sources, and data time points

e.g.,

         NHS      Private   Other   Sum
Jan      100      100       100     300
Feb      120      80       50      250
March    50       105       400    555

How can I use the Sum column to mutate across the DF to create new variables based on the percentage of each column to Sum at that time-point e.g.

        NHS    Private    Other     Sum
Jan     33.3%    33.3%     33.3%     100%     **and so on** 
Feb     N%       N%
March   N% 
Phil
  • 7,287
  • 3
  • 36
  • 66
Snight
  • 1
  • 1
  • Hello, I have marked your question as a duplicate of an existing question. If the answers there don't answer your question, please let me know by replying here - and ideally edit your question to clarify its uniqueness. – Sam Firke Aug 16 '23 at 16:20

0 Answers0