LinRegIntercept
Calculates the intercept (b) of the linear regression line (y = a·x + b) between two numeric expressions over a specified set.
Syntax
LinRegIntercept(Set_Expression, Y_Numeric_Expression [, X_Numeric_Expression])
Arguments
Set_Expression | MDX expression that returns a set of data points used for the regression analysis. |
|---|---|
Y_Numeric_Expression | Numeric expression that represents the Y-axis values for the function. |
X_Numeric_Expression | (Optional) Numeric expression that represents the X-axis values. If not specified, the function uses the current context as X-axis values. Not specifying the x-axis argument is frequently used with the Time dimension. |
Examples
Date when Story Points remaining will reach zero
The following example works with Time dimension Day level members in Rows, filtered by the current ongoing Sprint in the Page filter. Use the "Time within Sprint" measure and apply "Filter rows > 0" to this column.
Next, click on any Time member in Rows and apply "Filter time <= 'today'" filter to show only the days of sprint until the current day.
Create a new measure with the following formula to determine in which date the Story Points remaining will reach zero based on the linear regression of the current progress.
This formula calculates the intercept and slope of the linear regression to determine when the Story Points remaining measure will reach 0.
DateAddDays(
-- retrieve the first visible date in Rows
VisibleRowsSet().Item(0).Item(0).Name,
-- add the number of days until SP remaining will reach 0
(
-- find the intercept of the linear regression
(
LinRegIntercept(
VisibleRowsSet(),
[Measures].[Story Points remaining],
Rank(
CurrentTuple(VisibleRowsSet()),
VisibleRowsSet()
)
)
* -1
)
/
-- find the slope of the linear regression
LinRegSlope(
VisibleRowsSet(),
[Measures].[Story Points remaining],
Rank(
CurrentTuple(VisibleRowsSet()),
VisibleRowsSet()
)
)
)
)
See also
- Function DateAddDays adds a specific number of days to a date.
- Function LinRegSlope calculates the slope of the linear regression.
- Function VisibleRowsSet returns a set of members currently visible in Rows.
- Function Rank returns a numeric value ranking based on the tuple and set provided.