Forum Discussion
Distribute value between start and end date, including ending sum
- 2 years ago
Hi thomma -To get the contract amount over the duration of the contract and then add an additional 3%.
Create a calculated column with 3% of distribution daily amount
DailyAmount =
DIVIDE(
Contracts[ContractAmount],
DATEDIFF(Contracts[StartDate], Contracts[EndDate], DAY)
)AdditionalAmount = Contracts[ContractAmount] * 0.03
AdditionalDate = EDATE(Contracts[EndDate], 3)Create a new table that crossjoins the Contracts table with the Dimension Date table and includes the additional 3% amount:
ContractDistributions =
VAR CrossJoinTable =
FILTER(
CROSSJOIN(Contracts, DimDates),
(DimDates[Date] >= Contracts[StartDate] && DimDates[Date] <= Contracts[EndDate])
|| DimDates[Date] = Contracts[AdditionalDate]
)VAR AddColumnsTable =
ADDCOLUMNS(
CrossJoinTable,
"DistributedAmount",
IF(
DimDates[Date] = Contracts[AdditionalDate],
Contracts[AdditionalAmount],
Contracts[DailyAmount]
)
)
RETURN
AddColumnsTableadd ContractDistributions table and use it in your report and see the distribution amount across contract period.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Hi thomma -To get the contract amount over the duration of the contract and then add an additional 3%.
Create a calculated column with 3% of distribution daily amount
DailyAmount =
DIVIDE(
Contracts[ContractAmount],
DATEDIFF(Contracts[StartDate], Contracts[EndDate], DAY)
)
AdditionalAmount = Contracts[ContractAmount] * 0.03
AdditionalDate = EDATE(Contracts[EndDate], 3)
Create a new table that crossjoins the Contracts table with the Dimension Date table and includes the additional 3% amount:
ContractDistributions =
VAR CrossJoinTable =
FILTER(
CROSSJOIN(Contracts, DimDates),
(DimDates[Date] >= Contracts[StartDate] && DimDates[Date] <= Contracts[EndDate])
|| DimDates[Date] = Contracts[AdditionalDate]
)
VAR AddColumnsTable =
ADDCOLUMNS(
CrossJoinTable,
"DistributedAmount",
IF(
DimDates[Date] = Contracts[AdditionalDate],
Contracts[AdditionalAmount],
Contracts[DailyAmount]
)
)
RETURN
AddColumnsTable
add ContractDistributions table and use it in your report and see the distribution amount across contract period.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!