
This is in Tableau Prep
I've taken project to date revenue and disaggregated it by adding month/yr such that now I have revenue by month/yr. In some cases however, based on the contract type, I need to make an adjustment to the monthly revenue figure to prevent it from duplicating the total contract value each month. Instead when Condition X exists the revenue should only appear in the earliest month/yr for the particular contract. For this example lets say if the prior month revenue value is >0 then the following month revenue should be zero
Currently data appears as (contract, month, monthly revenue)
Contract 1, Jan. $500,000
Contract 1, Feb, $500,000
Contract 1, Mar, $500,000
Desired state when condition X exists
Contract 1, Jan, $500,000
Contract 1, Feb, $0
Contract 1, Mar, $0
@Matt Gonzalez
a. First create a FIXED Calculation . (I am assuming your month is a date field)
[Min Date] = {FIXED [contract]:MIN(month)}b. Then replace [monthly revenue]
IF [Min Date]=[Date] THEN [monthly revenue] ELSE 0 END
and you will get it.
If this post assists in resolving the question, please "Upvote" it or "Select as Best" if it resolves the question. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.
Regards,
Diego