Dynamic user defined calculations

One of the next features in Power BI is the ability for a user to create a calculation at any of the modelling tiers.

This example is aimed at the end user who wants to add a dynamic calculation, in this case to calculate an average sale price using a combination of Amount and Quantity. The example can be modified for any similar calculation.

The basic process is, right click on the data table and select New Measure and then in the formula bar that appears at the top of the screen add in the following script (modified to suit).

Once you have entered the formula, click the Commit (green tick) icon and then voila, it’s there to be used in a report.

ASP = 
Var vSales = Sum (Sales[Amount] )
Var vQty = Sum (Sales[Quantity] )
Return
DIVIDE(vSales,vQty)
Next
Next

Create a variance measure