Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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...
  • v-zhangti's avatar
    v-zhangti
    3 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.