Forum Discussion
Calculated Table for progressive costs
- Anonymous2 years ago
Hi Flabenu ,
According to your statement, I think [PROJECTID] and [YEAR-MONTH] you need are both in 'ACTUAL' table.
You can just create the calculated table based on 'ACTUAL' table.
I am still confused about the calculation logic about [COSTITOT] which is based on PROJECT/YEAR-MONTH.
Do you want to get a table which will show progressive costs? I think it should be comulative amount/ comulative quantity.
I think you can try code as below to create a calculated table.
Calculated Table = SUMMARIZE ( 'ACTUAL', 'ACTUAL'[PROJECTID], 'ACTUAL'[YEAR-MONTH], "Progressive Costs", VAR _Quantity = CALCULATE ( SUM ( 'ACTUAL'[QUANTITY] ), FILTER ( 'ACTUAL', 'ACTUAL'[PROJECTID] = EARLIER ( [PROJECTID] ) && 'ACTUAL'[YEAR-MONTH] <= EARLIER ( [YEAR-MONTH] ) ) ) VAR _AMOUNT = CALCULATE ( SUM ( 'ACTUAL'[AMOUNT] ), FILTER ( 'ACTUAL', 'ACTUAL'[PROJECTID] = EARLIER ( [PROJECTID] ) && 'ACTUAL'[YEAR-MONTH] <= EARLIER ( [YEAR-MONTH] ) ) ) RETURN DIVIDE ( _AMOUNT, _Quantity ) )Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Flabenu ,
According to your statement, I think [PROJECTID] and [YEAR-MONTH] you need are both in 'ACTUAL' table.
You can just create the calculated table based on 'ACTUAL' table.
I am still confused about the calculation logic about [COSTITOT] which is based on PROJECT/YEAR-MONTH.
Do you want to get a table which will show progressive costs? I think it should be comulative amount/ comulative quantity.
I think you can try code as below to create a calculated table.
Calculated Table =
SUMMARIZE (
'ACTUAL',
'ACTUAL'[PROJECTID],
'ACTUAL'[YEAR-MONTH],
"Progressive Costs",
VAR _Quantity =
CALCULATE (
SUM ( 'ACTUAL'[QUANTITY] ),
FILTER (
'ACTUAL',
'ACTUAL'[PROJECTID] = EARLIER ( [PROJECTID] )
&& 'ACTUAL'[YEAR-MONTH] <= EARLIER ( [YEAR-MONTH] )
)
)
VAR _AMOUNT =
CALCULATE (
SUM ( 'ACTUAL'[AMOUNT] ),
FILTER (
'ACTUAL',
'ACTUAL'[PROJECTID] = EARLIER ( [PROJECTID] )
&& 'ACTUAL'[YEAR-MONTH] <= EARLIER ( [YEAR-MONTH] )
)
)
RETURN
DIVIDE ( _AMOUNT, _Quantity )
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.