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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

LINESTX bugs

Using Power BI Report Server, the following issues exist for LINESTX...

 

LINESTX does not report values in row context, so variance to Y-Axis values cannot be calculated...

kopite833_0-1692232809156.png

 

KnownX values must be placed in the X-Axis field well to display and evaluate the line...

 

kopite833_1-1692232992010.pngkopite833_2-1692233072756.png

 

Polynomial regression does not appear to work...

 

Order3PolyRegression =
VAR Line =
    LINESTX (
        ALLSELECTED ( Trade[KnownX] ),
        [KnownY],
        [KnownX],
        [knownY],
        [KnownX] ^ 2,
        [knownY],
        [KnownX] ^ 3
    )
VAR Slope1 =
    SELECTCOLUMNS ( Line, [Slope1] )
VAR Slope2 =
    SELECTCOLUMNS ( Line, [Slope2] )
VAR Slope3 =
    SELECTCOLUMNS ( Line, [Slope3] )
VAR Intercept =
    SELECTCOLUMNS ( Line, [Intercept] )
VAR x =
    SELECTEDVALUE ( Trade[KnownX] )
VAR Result = ( x ^ 3 * Slope3 ) + ( x ^ 2 * Slope2 ) + ( x * Slope1 ) + Intercept
RETURN
    Result

 

kopite833_3-1692233219744.png

 

 

Status: Needs Info
Comments
Anonymous
Not applicable

Hi  @kopite833 ,

 

Can you provide detailed version information so we can reproduce the issue? We'll get back to the product team as soon as it's acknowledged as an issue!
Thanks in advance!

 

Best regards.
Community Support Team_Caitlyn

kopite833
Frequent Visitor

Found work around for the 1st 2 notes in my original post, but the polynomial regression formula I provided doesn't work. The formula I provided should produce a seasonal trend line with 2 curves (dark blue), more closely aligned to the actuals (light blue). 

kopite833
Frequent Visitor

Suggest a better implementation of LINESTX would be...

 

LINESTX ( <table>, <expressionY>, <expressionX>, <const>, <regressiontype>, <ouput>)

 

Where <regressiontype> and <output> provide options user chooses, as follows...

 

Regression type: linear, polynomial_2, polynomial_N (up to 6, like Excel), etc

 

Output: slope(s), intercept, standarderrorslope(s), line values, other stats, etc