Forum Discussion
ArchStanton
3 years agoPower Participant
Trendline needed
I have a simple linechart with MonthName on the x-axis (this is derived from my own custom built calendar going from Apr to Mar as per Financial Year) and a DISTINCTCOUNT Measure of IDs for the Y axi...
- 3 years ago
nleuck_101
3 years agoContinued Contributor
ArchStanton
Your Known[X] & [Y] become the new names of the fields. You don't need to substitute anything else. For example:
VAR SlopeIntercept =
LINESTX(Known, Known[Y], Known[X])
You do not need to replace Known[Y] or Known[X] with anything. You've already identified them earlier in the VAR Known.
Does that make sense? Are you receiving an error?
Does that make sense? Are you receiving an error?
ArchStanton
3 years agoPower Participant
VAR Known =
FILTER(
SELECTCOLUMNS(
ALLSELECTED(Date2[Date]),
"Known[X]", Date2[Date]
"Known[Y]", [DISTINCT COUNT & SUM]
),
AND(
NOT(ISBLANK(Known[X])),
NOT(ISBLANK(Known[Y]))
)
)
VAR SlopeIntercept =
LINESTX(Known, Known[Y], Known[X])
VAR Slope =
SELECTCOLUMNS(SlopeIntercept, "Slope", [Slope1])
VAR Intercept =
SELECTCOLUMNS(SlopeIntercept, "Intercept", [Intercept])
RETURN
AVERAGEX(
DISTINCT(Date2[Date]
Intercept + Slope * Table[Date]
)