The SSRS Log function is a Mathematical function that returns the natural logarithmic value of base e of the given numeric field (number). The syntax of the Log function to return the base e logarithmic value of a number is as shown below.
=Log(5)
To demonstrate the Log function in Reporting Services, we use the Products table below, which has 14 records. The image shows the records in the table report; the result is in an empty column.
SSRS Log function Example
To do this, right-click the textbox under the Result Header and choose the Expression to open the window below. The Log function below finds and returns the base e logarithmic value of the orders column.
=Log(Fields!Orders.Value)
Similarly, let me create two more new columns to the right of the Cost and Sales and name them Log Cost and Sales Log. The two SSRS Log function expressions below find the natural logarithmic value of base e for the Standard Cost and Sales Amount columns.
=Log(Fields!StandardCost.Value)
=Log(Fields!SalesAmount.Value)
Please click the preview tab to see the Log report. To adjust the decimal precision, use the FormatNumber or Round function.