Forum Discussion
Anonymous
4 years agoNot applicable
y=mx+c
I want to use y= mx+c to calculate y on the dates that are in b/w the years. so first how I will calculate "m" and "C" using given table. Date y x calculated column m calculated comumn...
- 4 years ago
Hi, Anonymous
You can try the following methods.
Column:
m = LOOKUPVALUE('Table'[m],'Table'[Date],[Date])C = LOOKUPVALUE('Table'[C],'Table'[Date],[Date])M1 = MINX(FILTER('Table (2)',EARLIER('Table (2)'[Date])<=[Date]),[m])C1 = MAXX(FILTER('Table (2)',EARLIER('Table (2)'[Date])<=[Date]),[C])Y1 = [M1]*[x]+[C1]You said: "for example for 1/10/2017 y = (1203.31 * 260) + 1156693.38 =1469553.98".
It is not exactly equal to this value because both M1 and C1 have hidden decimals.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
Community Support
4 years agoHi, Anonymous
You can try the following methods.
Column:
Previous y = MAXX(FILTER('Table',[Date]<EARLIER('Table'[Date])),[y])Previous x = MAXX(FILTER('Table',[Date]<EARLIER('Table'[Date])),[x])
m = IF([Previous x]<>BLANK()&&[Previous y]<>BLANK(),DIVIDE([y]-[Previous y],[x]-[Previous x]))C = IF([m]<>BLANK(),[y]-([m]*[x]))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Syndicate_Admin
Administrator
4 years agoAny update on this please? Really appricate if you can help me