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 not having it.
Measure
RME-FAME0 Spread/Soybean Oil 90-Day Rolling =
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 Result =
CALCULATE (
DIVIDE ( [Correlation Coefficent 7], NumberOfDays ),
DimdatesToUse
)
RETURN
Result*90
Error Message
Sample File - Data
https://www.dropbox.com/s/vzt3cqk5w9x5b3m/TestData.pbix?dl=0
Hi , @BlueWhite111
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
Hi Aniya - can you kindly provide PBIX - slightly confused here. Thanks
Hi, @BlueWhite111
I just modify the dax here in your measure:
This can resovle the issue , but it put in the visual it will return null due to the [Correlation Coefficent 7] returns null in this visual , you need to check this measures's logic when the filter context is put in this visual.
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
Error Message}
Hi Aniya the measure errors when you add the measure to a standard table based on the date coming from BIODIESEL table
this is my final measure
Hi Support
Is your code a calculated column measure?
User | Count |
---|---|
122 | |
60 | |
60 | |
52 | |
40 |
User | Count |
---|---|
115 | |
64 | |
59 | |
54 | |
48 |