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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Irwan
Solution Supplier
Solution Supplier

Need Help on Autocorrelation Calculation

Hello Power BI expert,

 

I need an advice on how to do autocorrelation calculation in Power BI.

for now i am trying to replicate the result from excel tutorial.

Irwan_0-1702511735040.png

I read there are two ways of calculation autocorrelation:

1. Using OFFSET and DEVSQ

Irwan_2-1702511938532.png

2. Using VAR.P

Irwan_1-1702511885274.png

 

Here is the website link that i currently work on to replicate the result How to Calculate Autocorrelation in Excel - Sheetaki

 

Is it possible to re-create what the excel did in Power BI? I tried to make it myself but the result is different.

Irwan_3-1702512715107.png

 

Thank you and really appreciate for the help.

1 ACCEPTED SOLUTION

Here you go

 

lbendlin_0-1702784874050.png

 

View solution in original post

9 REPLIES 9
lbendlin
Super User
Super User

Most likelky not.  Power BI has no memory and no concept of self-referencing without becoming all upset about circular references.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Irwan
Solution Supplier
Solution Supplier

Hello @lbendlin 

 

here is the sample data. Basically that is a data came from the website that i mentioned (I am trying to recreate the result before applying it into real data).

Jan56
Feb58
Mar69
Apr50
May66
Jun68
Jul78
Aug73
Sept88
Oct90

 Here is the result that I wish to get in Power BI

Irwan_0-1702773676099.png

 

However, if Power BI has no memory or concept of self-referencing, then it is impossible doing autocorrelation in Power BI?

 

Thank you and really appreciate for the help.

Here you go

 

lbendlin_0-1702784874050.png

 

Irwan
Solution Supplier
Solution Supplier

Hello @lbendlin 

 

that DAX is superb, thank you.

I dont know if there is a sumx offset at line 6 (maybe) as a "bridge" before sumx the whole result as in Line 8 (thought it can be done directly by using earlier indexing).

I need to work again on my DAX understanding as a beginner.

 

Again, thank you and really appreciate for the help.

As always you can approach the issue with different DAX functions but you will want to unlearn EARLIER and embrace the window functions. Makes the shifted reference so much easier.

Irwan
Solution Supplier
Solution Supplier

hello @lbendlin 

 

sorry in advance, i got another question, is it possible to put the measure (the correlation result) into a new column?

 

Thank you and appreciate for the help.

You cannot create columns from measures. You would need to modify the code to create a calculated column instead

Irwan
Solution Supplier
Solution Supplier

Hello @lbendlin 

 

alright then, thank you again for the help and support.

Ah, that's actually simple - basically a special case for a Pearson correlation within the column.  Let me play with that a bit.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors