A table calculation works on the numbers already in the view, after Tableau has aggregated them. Right-click a measure and choose Quick Table Calculation for the common ones: Running Total, Difference, Percent Difference, Percent of Total, Rank, Percentile and Moving Average. A small triangle appears on the pill.
Every table calculation has a direction, set under Compute Using. The default, Table (across), runs left to right along each row of the table. When your dimension is on Rows, the marks run top to bottom, so you need Table (down). If every bar shows 100%, check the direction first.
You can write the same logic in a calculated field with functions like RUNNING_SUM(SUM([Sales])) and WINDOW_SUM(SUM([Sales])). Their arguments must be aggregated, because table calculations only see the aggregated view.