In this article, we have explained how to use Measure in Pivot Pivot data model. We have taken the example of SUMX function to calculate the revenue. On the base of Price Per Unit from related table and Quantity from fact table.
SUMX function:
SUMX function returns the sum of an expression evaluated for each row in a table. it takes as its first argument a table, or an expression that returns a table. The second argument is a column that contains the numbers you want to sum, or an expression that evaluates to a column.
Syntax
SUMX(<table>, <expression>)
table: The table containing the rows for which the expression will be evaluated.
expression: The expression to be evaluated for each row of the table.
Below is the function which we have used in this scenario:
Revenue (Measure):=SUMX(Orders,Orders[Quantity]*RELATED('Product Master'[Price per unit]))
Click here to download the practice file.
Watch the step by step video tutorial:
Visit our YouTube channel to learn step-by-step video tutorials