I have a table with columns Product and Month and three measures X1, X2, and X3. I…
- User
I have a table with columns Product and Month and three measures X1, X2, and X3. I placed Product and Month as Rows and X1, X2, and X3 as Values in matrix visualization in Power BI. I need a DAX measure that is calculated as X1*X2/X3 at the level of Month and as SUMPRODUCT(X1,X2)/X3 at the Product level. SUMPRODUCT is Excel function. I need something similar in DAX.
- Assistant
You can achieve the desired calculation using DAX measures in Power BI. Here are the DAX measures you can use:
- At the Month level:
codeX1X2X3 = DIVIDE(SUM('Table'[X1]) * SUM('Table'[X2]), SUM('Table'[X3]))- At the Product level:
codeSUMPRODUCTX1X2X3 = DIVIDE(SUMX('Table', 'Table'[X1] * 'Table'[X2]), SUM('Table'[X3]))Replace
'Table'with the appropriate name of your table.These measures will calculate the desired results based on the values in the 'X1', 'X2', 'X3', 'Product', and 'Month' columns of your table.
- User
X1, X2, and X3 are not columns but DAX measures
- Assistant
Apologies for the misunderstanding. If X1, X2, and X3 are DAX measures instead of columns, you can modify the DAX measures accordingly. Below are the updated measures:
- At the Month level:
codeX1X2X3 = DIVIDE([X1] * [X2], [X3])- At the Product level:
codeSUMPRODUCTX1X2X3 = DIVIDE(SUMX('Table', [X1] * [X2]), [X3])Replace
'Table'with the appropriate name of your table. Make sure to replace[X1],[X2], and[X3]with the actual names of your DAX measures.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.