7 Replies Latest reply on Aug 24, 2018 12:29 PM by Deepak Rai

# Need help with how to do a calculation

I have a Rate field that I need to display only the value based on the MAX(SalesDeliveryDate)

How would I do this in Tableau?

• ###### 1. Re: Need help with how to do a calculation

Hi

first find the fixed max date as           {fixed:max(salesdeliverydate)}

the           if Min((saledeliverydate)= min(fixed max date from above )  then  ...

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Need help with how to do a calculation

{FIXED: SUM(IF {MAX([SalesDeliveryDate]}=[SalesDeliveryDate] THEN [RatePerTon] END)}

• ###### 3. Re: Need help with how to do a calculation

It's close, but It's giving me the max RatePerTon overall instead of giving me the RatePerTon of the company.  Also I have to write the formula like this or I get errors

{FIXED: SUM(IF {MAX([SalesDeliveryDate])}=[SalesDeliveryDate] THEN [RatePerTon] END)}

placing a ) after ] and before first }

I'm using tableau 10 desktop

• ###### 4. Re: Need help with how to do a calculation

{FIXED Company: SUM(IF {FIXED Company:MAX([SalesDeliveryDate])}=[SalesDeliveryDate] THEN [RatePerTon] END)}

• ###### 5. Re: Need help with how to do a calculation

Your Question Did not Mention that and I was sure that you will come back asking per company or person

• ###### 6. Re: Need help with how to do a calculation

Thank you so much, I did forget that, that's my fault, but thank you for the answer.  I really appreciate it.

• ###### 7. Re: Need help with how to do a calculation

..I Think You have Another one for POWER BI, There also you missed Company