Forum Discussion
Calculating value from table values
- 7 years ago
Thanks Thejeswar
I am happy with the result. We round the variance value to a whole number, so it will be 0% in this case, which is what would be expected.
Cheers
I have extracted data from the tables to try to explain what is required. These three tables are where the base data is drawn.
Table 1 - Budget
| IdentifierId | Funding Status | Funding Type | Budget |
| 5 | Planned | OPEX | 136244 |
| 5 | Allocated | OPEX | 136244 |
| 5 | Released | OPEX | 136244 |
| 5 | Released | OPEX | 15400 |
| 9 | Planned | CAPEX | 358125 |
| 9 | Allocated | CAPEX | 358125 |
| 9 | Released | CAPEX | 358125 |
| 9 | Planned | OPEX | 77948 |
| 9 | Allocated | OPEX | 77948 |
| 9 | Released | OPEX | 77948 |
| 9 | Planned | OPEX | 181880 |
| 9 | Allocated | OPEX | 181880 |
| 9 | Released | OPEX | 181880 |
| 9 | Planned | OPEX | 103567 |
| 9 | Planned | OPEX | 517835 |
Table 2 Actuals
| IdentifierId | Actuals to Date | Expense Type |
| 5 | 72680 | OPEX |
| 5 | 11334 | OPEX |
| 5 | 43555 | OPEX |
| 9 | 966 | OPEX |
| 9 | 8574 | OPEX |
| 9 | 298425 | CAPEX |
| 9 | 19614 | OPEX |
Table 3 - Forecast
| Title | IdentifierId | Forecast to Complete |
| Forecast for period 1Aug2018 to 31Aug2018 | 5 | 14112 |
| Forecast for period 1Aug2018 to 31Aug2018 | 9 | 289893 |
The report shows the Budget as sum of CAPEX and OPEX amounts, with a Status of "Released" for each identifier, Actuals as the sum of all amounts for each of the identifier, and for Forecast, the table is filtered so only the most recent amount for each identifier is shown. For project 5 it would look like this:
| Budget | Actuals | Forecast | |
| 5 | 151644 | 127569 | 14112 |
I want to calculate the variance between actual costs plus what is forecast and the budget, which is calculated as "(Budget/(Actual + Forecast"))/Budget". For project 5 this calculates as 0%.
If this is too hard to do, I will fall back to Plan B and export the report to excel and add the variance to the report there.
Hope this helps
Hi kennoe,
Went through your data. Can you also tell what is the expected Vaiance for your Identifier 5?
As far as I tried, the value comes as 0. But if you look deeply, it is not 0%. It is something like 0.00070581%
Going by the formula which you have given, for Identifier 5,
Budget = 151644
actuals + Forecast = 127569+14112 = 141681
The Variance Calculation would be something like this
(151644/ 141681) / 151644 = 0.0000070581
When multiplied by 100, it becomes 0.00070581%
I am afraid going by this formula, even excel is going to give the same value.
Click here for the PBIX with the same shown
Clarify if I am missing something here...?
- kennoe7 years agoHelper I
Thanks Thejeswar
I am happy with the result. We round the variance value to a whole number, so it will be 0% in this case, which is what would be expected.
Cheers
- kennoe7 years agoHelper I
While the solution proposed was correct, I have not been able to make it work in real life. My actual data is more complex than the example used to devise the solution and I think there is an issue with the relationships between the tables that is causing the problem.
Here is the relationship chart for the example data:
Example data only
This is the chart for the actual data:
The extra table is the only real difference between the charts and it means I cannot have the same relationships between the tables.
Any help appreciated.
Steve
- Thejeswar7 years agoSuper User
Hi kennoe,
Try this approach. Not sure how this will suit for your data.
If possible can you remove the join between the Actual Expense and Initiative Register. That should be aloowing you to make the join beween Actual Expense and Forecast as active. My guess is it will not affect the relationship between Actual Expense and Initiative Register as these tables will continue to be related through Forecast table
Note: Keep the join between them Bi-directional, so that the Initiative Register table continues to be in the model and respond for any changes that happen with the Forecast Table while slicing and Dicing the data