Forum Discussion
Ethanhunt123
Helper IV
2 years agoLINESTX with slicer
Hello, I am trying to calculate trends using slope and intercept I am using the following DAX, which is functioning well. However, the issue arises when I have a slicer on the order date. I...
- 2 years ago
Ethanhunt123 Hi! Try with:
Revenue trend =
VAR line =
LINESTX (
ALLSELECTED('Sales order line fact'[Order date]), -- This respects the slicer
[Total revenue trend],
'Sales order line fact'[Order date]
)
VAR slope = SELECTCOLUMNS(line, [Slope1])
VAR intercept = SELECTCOLUMNS(line, [Intercept])
VAR x = SELECTEDVALUE('Sales order line fact'[Order date])
VAR y = x * slope + intercept
RETURN yBBF
Ethanhunt123
Helper IV
2 years agoI have tried this but I don't think so this is working see below
Data without the filter on date
Data with the filter on the date - From Jan 1 till Sept
Values are the same as above. My assumption is if I am changing dataset then values should also get change
BeaBF
Super User
2 years ago