Here I have attached screenshot and twbx file both. you can see below image.
Here You can see that calculated field which I used in this view.
Please go through twbx file as well for better understanding.
Please mark correct and helpful if it works for you.
% of Total by month.twbx 1.0 MB
Its already there in quick table calculation, See the screen shot. Drag you measure in canvas and follow steps
Note: While using table calculation you need to set the data partitioning and addressing based on your requirement. For more information you can follow this kb article
And to see the calculation you can edit the measure by double click on it. like this
Hope this help.
Depending on what you are trying to achieve you could also use LOD to calculate the percent of total sales by month for each category using the calculation shown below.
With the LOD method, you can filter on only one category and still retain the percent of total for the selected category.
I hope you find this helpful.