Correlation coefficient
This is wonderfully useful thanks Daniil
I've been trying to modify your DAX to use in a scenario where the variables to be correlated are pivoted and the categories are contained in an attribute column (example below). Sadly I'm not having much luck, does anyone have any suggestions on how to generate a correlation matrix with this data structure?
| Item | Attribute | Value |
| A | Value X | 2 |
| B | Value X | 3 |
| C | Value X | 5 |
| D | Value X | 7 |
| A | Value Y | 0 |
| B | Value Y | 1 |
| C | Value Y | 1 |
| D | Value Y | 2 |
- lbendlin5 years agoSuper User
Statistics only work with numbers. You need to add numerical key columns for your text columns before you can calculate the correlation.
- Anonymous4 years agoNot applicable
Apologies for reviving an old question however I want to check your response to systemnova if you wouldn't mind.
Say I wanted to check the correlation between day of the week and temperature and had collected the below data:Index Category Temp 1 Monday 20 2 Monday 24 3 Monday 19 4 Wednesday 15 5 Wednesday 28 6 Wednesday 12 7 Wednesday 20 8 Friday 20 9 Friday 10 Are you saying I can swap the days of the week for a numerical key such as Monday = 1, Wednesday = 2 and Friday = 3 to give the below and then use this quick measure to produce meaningful results? Unfortunately I am still very new to stats and Power BI. Any direction would be greatly appreciated. Thanks.
Index Category Temp 1 1 20 2 1 24 3 1 19 4 2 15 5 2 28 6 2 12 7 2 20 8 3 20 9 3 10 - lbendlin4 years agoSuper User
yes, that's what I am saying. Replace text values with their numerical index and compute the correlation over the indexes. Afterwards you can map it back.
(bit unfortunate that your sample table has an "Index" column. Please discard that, it doesn't help)