Forum Discussion
error with VALUES
- 8 years ago
Hi Lexey,
The issue here is your aggregation level, using the all fact table to make your percentage when you add several columns from your table it will give you the total cost divided by all the slice and dices so not 100% per column. Because you are making it at a Jobs level you need to calculated it at that level so you need to change your percentage to:
Procentage = CALCULATE([total cost] / CALCULATE([total cost]; ALL('fact'[jobs])))Other issue is Budget value you are making a sumX of the plan and then multiplying that sumx by the porcentage on SUMX the calculations are made line by line and then summed so you need to calculate for each cost line the percentage value and then do the sum you need to change it to:
Values of budget = SUMX(plan;plan[plan] * [Procentage])
See result am PBIX file below:
Regards,
MFelix
Hi Lexey,
Without better information is difficult to get your error, but from the Error message and the measures I'm pointing to Values of Budget you are getting the VALUES and multiplying it by a percentage this will give you error since for a measure you need to a single value based on context like the measure is you are getting all the values and not giving it any context.
If you want to calculate a single value per contract maybe you should try a SUMX for your calculations that will make an interaction per each row of your tables.
However in order to help you better you must provide some sample data and expected result, the screenshot is not elucidative and neither are your measures regarding the model and the setup you have.
Regards,
MFelix
- Lexey8 years agoHelper I
I prepared the file. https://drive.google.com/open?id=1NfAeo4P2d9axo-0znBtYJ1bU_skKJWP7
The problem 1-distribute the planning budget in the ratio as it is now distributed running costs, if you choose one building. All expenses of one building is 100%, the distribution between works as a percentage.
Problem 2-when I select two buildings in the slicer, the total percentage of 100% starts to be distributed between the two buildings 46% and 64% . How to fix 100% of each building.
need help- MFelix8 years agoSuper User
Hi Lexey,
The issue here is your aggregation level, using the all fact table to make your percentage when you add several columns from your table it will give you the total cost divided by all the slice and dices so not 100% per column. Because you are making it at a Jobs level you need to calculated it at that level so you need to change your percentage to:
Procentage = CALCULATE([total cost] / CALCULATE([total cost]; ALL('fact'[jobs])))Other issue is Budget value you are making a sumX of the plan and then multiplying that sumx by the porcentage on SUMX the calculations are made line by line and then summed so you need to calculate for each cost line the percentage value and then do the sum you need to change it to:
Values of budget = SUMX(plan;plan[plan] * [Procentage])
See result am PBIX file below:
Regards,
MFelix
- Lexey8 years agoHelper I
Thank you very much! At first I was glad, but the joy was short-lived, after I moved the measures on my data, why it did not work. Probably because in the original table each work can be repeated more than once, there is no more difference. I still need help.