Hi,
According to your description, you want to add a calculated column to the matrix, right?
In our local environment, we have tested this scenario and your requirement can be achieved by using custom code. In your scenario, since we need to calculate the amount based on the column values dynamically. For you requirement, we can use custom code
to store the column value, and then when to use them based on your requirement. Please refer to the following steps:
- Add the following custom code into your report. (You may modify the "OneProject" based on your ProjectType)
Public Shared Value1 as Integer
Public Shared Value2 as Integer
Public Shared OneProject as string
Public Shared Function GetValue(Value as Integer,projectType as String) as Integer
If projectType = "OneProject" Then
Value2=Value
Else
Value1=Value
End If
return Value
End Function
Public Shared Function GetPct()
return Value2 / Value1
End Function
Create a matrix like below:
Expr1 expression: =Code.GetValue(Fields!Amount.Value,Fields!ProjectType.Value)
Expr2 expression: =Code.GetPct()
The result is like below:
If you have any question, please feel free to ask.
Regards,
Shrek Li