PRODUCT DAX Function (Aggregation)
Returns the product of given column reference.
Syntax
Parameter | Attributes | Description |
---|---|---|
ColumnName |
Column that contains values for product. |
Return values
The product of the numbers in a column.
Remarks
The PRODUCT function internally executes PRODUCTX, without any performance difference.
The following PRODUCT call:
PRODUCT ( table[column] )
corresponds to the following PRODUCTX call:
PRODUCTX ( table, table[column] )
Examples
-- PRODUCT is the short version of PRODUCTX -- PRODUCTX multiplies values in the rows it scans -- -- The report shows the actualized sales in 2009 by applying -- the inflation rate in sales made in previous years DEFINE MEASURE Rates[Compound Inflation Rate] = PRODUCTX ( Rates, 1 + Rates[InflationRate] ) MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] ) MEASURE Sales[Actualized Sales 2009] = SUMX ( VALUES ( 'Date'[Calendar Year Number] ), VAR ReferenceYear = 2009 VAR BaseYear = 'Date'[Calendar Year Number] VAR CompoundRate = CALCULATE ( COALESCE ( [Compound Inflation Rate], 1 ), Rates[Year] >= BaseYear && Rates[Year] < ReferenceYear ) RETURN [Sales Amount] * CompoundRate ) MEASURE Sales[Adjustment %] = VAR ReferenceYear = 2009 VAR BaseYear = SELECTEDVALUE ( 'Date'[Calendar Year Number] ) VAR CompoundRate = CALCULATE ( COALESCE ( [Compound Inflation Rate], 1 ), Rates[Year] >= BaseYear && Rates[Year] < ReferenceYear ) RETURN IF ( NOT ISBLANK ( BaseYear ) && NOT ISBLANK ( [Sales Amount] ), CompoundRate ) EVALUATE Rates EVALUATE SUMMARIZECOLUMNS ( ROLLUPADDISSUBTOTAL ( 'Date'[Calendar Year], "IsTotal" ), "Sales Amount", [Sales Amount], "Adjustment %", [Adjustment %], "Actualized Sales 2009", [Actualized Sales 2009] ) ORDER BY [IsTotal], [Calendar Year]
Year | InflationRate |
---|---|
2,005 | 0.03 |
2,006 | 0.03 |
2,007 | 0.03 |
2,008 | 0.04 |
2,009 | 0.00 |
2,010 | 0.02 |
Calendar Year | IsTotal | Sales Amount | Adjustment % | Actualized Sales 2009 |
---|---|---|---|---|
2007-01-01 | false | 11,309,946.12 | 106.80% | 12,078,959.12 |
2008-01-01 | false | 9,927,582.99 | 103.84% | 10,308,802.18 |
2009-01-01 | false | 9,353,814.87 | 100.00% | 9,353,814.87 |
(Blank) | true | 30,591,343.98 | (Blank) | 31,741,576.16 |
Related functions
Other related functions are:
Last update: Nov 14, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/product-function-dax