5 Replies Latest reply on Jun 12, 2018 8:14 AM by meenu choudhary

    Calculating Multiple Rows of one Column Based on the Values in another column

    Albert Marsnik

      I know the title is kind of confusing, but I am relatively new to Tableau and the picture below and the following description should clear up what I'm after:




      In the picture above there are 3 important columns: ItemChangeDetails.id, ItemChangeDetails.PricingName, and ItemChangeDetails.Pricing.Value.  What I want to do is take each ItemChangeDetails.Pricing.Value from the rows where the ItemChangeDetails.PricingName = Price then multiply that number by the ItemChangeDetails.Pricing.Value where the ItemChangeDetails.PricingName = Quantity and add that to the ItemChangeDetails.Pricing.Value where the ItemChangeDetails.PricingName = TotalLaborCost.  Ideally this would give me a column "ItemPrice" that would give me the result of the previously mentioned calculation for each ItemChangeDetails.id.  Then I would also like to add a TotalProjectPrice column which adds up all of the ItemPrices.


      I have also attached the workbook that I was trying to do this in.


      Could someone please show me how to do what I have described above?