3 Replies Latest reply on Aug 6, 2018 5:44 AM by Lotte Van Doorss

# Calculating row sales on total sales of the segment

Hello,

I'm quite new to Tableau, and I'm trying to figure out how to calculate sales on total sales of the segment.

For example:

Client Id
SegmentSalesSales contribution
Client 1Segment ABC25025% (or 250/(250+750))
Client 2Segment ABC75075% (or 750/(250+750))
Client 3Segment XYZ40020% (or 400/(400+400+1200))
Client 4Segment XYZ40020% (or 400/(400+400+1200))
Client 5Segment XYZ120060% (or 400/(400+400+1200))

Is there a convenient way to do so? I have not yet figured this out and can't seem to find the right HELP articles.

Kind regards,

Lotte

• ###### 1. Re: Calculating row sales on total sales of the segment

Hi Lotte,

Try below logic:

1. Total Segment =  {FIXED [Segment]:sum([Sales])}

2. Sales contributions = sum([Sales])/sum([Total Segment])

Change the format "Sales contributions" to percentage.

1 of 1 people found this helpful
• ###### 2. Re: Calculating row sales on total sales of the segment

Hi Lotte,

Create a duplicate field on Segment.

Add a table calculation on Sales.

Edit this calc to get the desired result.

Hide the extra column by deselecting it.

~Tushar

1 of 1 people found this helpful
• ###### 3. Re: Calculating row sales on total sales of the segment

Thanks Meenu, worked like a charm!