Forum Discussion

SikY's avatar
SikY
New Member
4 years ago
Solved

data modeling

Hi everyone   I'm facing a big difficulty in data modeling. Wish someone could help me.   Let's say, in Table 1 below, SOP refers to the start date of production, life cycle refers to the number ...
  • v-zhangti's avatar
    4 years ago

    Hi, SikY 

     

    You can try the following methods.

    Table:

    Table 2 = 
    var _a = GENERATESERIES(year(MIN('Table 1'[SOP])),year(MAX('Table 1'[SOP]))+MAX('Table 1'[Life Cycle]))
    var _b = CROSSJOIN(_a,'Table 1')
    return
    FILTER(_b,[Value]>=[SOP].[Year]&&[Value]<=[SOP].[Year]+[Life Cycle]-1)

    Measure:

    Annual Revenue = 
    CALCULATE(SUM('Table 2'[Revenue]),FILTER(ALL('Table 2'),[Value]=SELECTEDVALUE('Table 2'[Value])))

    Is this the output 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.