Forum Discussion
Anonymous
3 years agoNot applicable
TRICY - DAX Measure Error
Hi Experts I cannot work out why the following correlation Coefficent measure are going wrong - All my other Correlation Coeffient Measure work just Fine the following one the sample file - It no...
v-yueyunzh-msft
3 years agoCommunity Support
Hi , Anonymous
Thanks for your sample data you provide. The dax code for this [Correlation Coefficent 7] seems a measure.
You can try to use this code:
RME-FAME0 Spread/Soybean Oil 90-Day Rolling 2 =
VAR NumberOfDays = 90
VAR MaxWorkingDay = MAX ( 'Dimdate'[Working Day Number] )
VAR MinWorkingDay = MaxWorkingDay - ( NumberOfDays - 1 )
VAR DimdatesToUse =
FILTER (
ALL ( 'Dimdate' ),
AND (
'Dimdate'[Working Day Number] <= MaxWorkingDay,
'Dimdate'[Working Day Number] >= MinWorkingDay
)
)
VAR CorrelationCoeff = [Correlation Coefficent 7]
VAR Result =
CALCULATE (
DIVIDE ( CorrelationCoeff, NumberOfDays ),
DimdatesToUse
)
RETURN
Result * 90
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
3 years agoNot applicable
Hi Support
Is your code a calculated column measure?