Forum Discussion
Correlation matrix
- 1 year ago
Hi GFire,
Below is the DAX code used to create the SalesData table:
SalesData =
SELECTCOLUMNS (
ADDCOLUMNS (
CROSSJOIN (
VALUES('YourUnpivotedTable'[Year]),
VALUES('YourUnpivotedTable'[Year])
),
"Sales",
CALCULATE (
SUM('YourUnpivotedTable'[Sales])
)
),
"Year", [Value1],
"Compare_Year", [Value2],
"Sales", [Sales]
)In this code, replace Replace 'YourUnpivotedTable' with the actual name of your unpivoted base table. This DAX statement generates a table displaying all combinations of Year and Compare_Year, together with their corresponding sales values. This serves as the basis for calculating the Pearson correlation using the measure I previously provided. If you would like me to incorporate this into the PBIX file and upload the updated version, please let me know.
Thank you.
If you do not give more specific about what you are looking for, it is impossible to help you
What are the nrs included in the matrix? 2000 in the cell (2017, 2017), what is that? What are the columns in rows and columns in the matrix?
If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi and Thank you for your attention. I hope this example can help you.