Formula Generator | DAX

DAX Formula for Revenue Calculation

This guide details a DAX formula to compute total revenue by multiplying product price and turnover within a sales table, utilizing the SUMX function for efficient row-wise evaluation.


Empty image or helper icon

Prompt

calculates revenue based on product price and turnover

Answer

DAX Formula for Calculating Revenue

To calculate revenue based on product price and turnover, we can leverage a simple DAX formula that multiplies these two components.

DAX Formula

The following DAX formula computes the revenue:

Revenue = SUMX(Sales, Sales[ProductPrice] * Sales[Turnover])

Explanation of the Formula

  1. SUMX Function:

    • This is an iterator function that evaluates an expression for each row in a specified table (in this case, Sales) and then returns the sum of those evaluations.
  2. Sales Table:

    • It represents a table that contains sales data, where each row corresponds to a different product sale.
  3. ProductPrice and Turnover:

    • These columns in the Sales table hold the respective values for each product: ProductPrice indicating the price per unit and Turnover representing the number of units sold.
  4. Expression:

    • The expression Sales[ProductPrice] * Sales[Turnover] calculates the revenue for each individual sale by multiplying the price of the product by the quantity sold.

Practical Example

Suppose you have the following Sales table:

ProductID ProductPrice Turnover
1 100 10
2 150 5
3 200 20

Using the DAX formula provided, the Revenue calculation would be performed as follows:

  • For Product 1: 100 * 10 = 1000
  • For Product 2: 150 * 5 = 750
  • For Product 3: 200 * 20 = 4000

The total revenue computed with the SUMX function would be:

  • Total Revenue = 1000 + 750 + 4000 = 5750

Conclusion

This DAX formula effectively calculates total revenue by iterating over the sales data and applying a multiplication operation between product price and turnover. This method can be adapted to various contexts within your data model as needed. For further learning and enhancement of DAX skills, consider exploring resources available on the Enterprise DNA Platform.

Create your Thread using our flexible tools, share it with friends and colleagues.

Your current query will become the main foundation for the thread, which you can expand with other tools presented on our platform. We will help you choose tools so that your thread is structured and logically built.

Description

This guide details a DAX formula to compute total revenue by multiplying product price and turnover within a sales table, utilizing the SUMX function for efficient row-wise evaluation.