Forum Discussion
Calculation not working in PBI Desktop.
Hello,
I have a problem with a calculated column (please see below) that is giving the wrong result for the Net Strategic Value in my PBI table.
The result should be around 40 and not 80.
As an example, I assume if the lowest value in the range of values is -50,000 and the highest +50,000, -25,000 would have a strategic value of 25 as it’s a quarter of the way between.
What can I do to have the correct strategic value for negative numbers?
var Max_value = CALCULATE(MAX(Costs[Net Surplus Generated from Sale]), ALL())
var Min_Value = CALCULATE(MIN(Costs[Net Surplus Generated from Sale]), ALL())
return ((Costs[Net Surplus Generated from Sale]-Min_Value) / (Max_value- Min_Value))*100
5 Replies
- amitchandak
Super User
Anonymous , This need to be a measure like
Net Surplus Sale Strategic Value =
var Max_value = CALCULATE(MAX(Costs[Net Surplus Generated from Sale]), ALL())
var Min_Value = CALCULATE(MIN(Costs[Net Surplus Generated from Sale]), ALL())
return Divide(Sum(Costs[Net Surplus Generated from Sale])-Min_Value, (Max_value- Min_Value))*100The first calculation you have given can work as new column
- AnonymousNot applicable
- amitchandak
Super User
Anonymous ,
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.