Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cyuan
Frequent Visitor

1 column data correclatio coefficient

Hi all, 

i would like to measure the correlation between different SKUs with sales history.

i have attached the sample data, they are all in one table.

 

can you please help?

 

CY

 

ProductCustomerMonthSales
A111A1/07/20231106
A111A1/08/20233851
A111A1/09/2023370
A111A1/10/20231355
A111A1/11/20232179
A111A1/12/20233610
A111A1/01/20243592
A111A1/02/20243616
A111A1/03/20242246
A111A1/04/20243443
A111A1/05/20242659
A111A1/06/20242463
A111A1/07/20243106
B222B1/07/2023946
B222B1/08/20231222
B222B1/09/20233622
B222B1/10/20233629
B222B1/11/20232870
B222B1/12/20233082
B222B1/01/20241350
B222B1/02/20242271
B222B1/03/2024675
B222B1/04/20242424
B222B1/05/20242517
B222B1/06/20241378
B222B1/07/20241964
C333C1/07/20231702
C333C1/08/20231915
C333C1/09/20232401
C333C1/10/20233128
C333C1/11/2023208
C333C1/12/20231711
C333C1/01/20242355
C333C1/02/20242789
C333C1/03/2024739
C333C1/04/20242399
C333C1/05/20242724
C333C1/06/20243142
C333C1/07/2024417
6 REPLIES 6
cyuan
Frequent Visitor

Hi ZD,

 

thanks for reply. I couldn't upload a sample file, basically I have a column of prodcut and one column of customer, column of month of sales, then another column of sales in units.

 

what I try to do is to work out a way to calculate correlation coefficient for one customer between all products with certain period of historical sales. 

 

cyuan_0-1724306633625.png

 

Anonymous
Not applicable

Hi @cyuan 

 

You can get this result by using the pivot column in Power Query:

vzhengdxumsft_0-1724315307394.png

Here are steps:

First of all, Select the Product column and click the Pivot column in the Transform pane:

vzhengdxumsft_1-1724315448389.png

vzhengdxumsft_2-1724315529908.png

The result is as follow:

vzhengdxumsft_3-1724315556557.png

 

But I can't understand how to get the 2%, 24% and -34%, if possible please share the logic of these results. 

vzhengdxumsft_4-1724315606080.png

 

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks ZD for prompt reply.

the % is calculated in Excel with forumla Correl(array1, array2)

 

cyuan_0-1724317233092.png

I try to use the dax quick measure correlation coeffecient however it ask for 2 columns, in this case it does't really help because i will have more than 2 columns. 

 

thanks

 

cyuan_1-1724317379057.png

 

)

Hello @cyuan 

 

Not sure if this match to your need but please have a look.

 

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-on-Autocorrelation-Calcula...

 

That was my post and answered by @lbendlin. The DAX works perfectly.

 

Thank you.

cyuan
Frequent Visitor

thanks Irwan, not precisely, @Ibendlin DAX is autocorrelation and it is a tool to look at correlation for one variable but different lag, it should eventually return to 0. What I am after is 1 v 1 correlation based but multiple comparison.

 

thanks anyway,.

Anonymous
Not applicable

Hi @cyuan 

 

Actually, I can't quite understand what you need.

If possible, please attach the expected result with backend logic and special examples? It would be helpful to find out the solution.

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.