Forum Discussion

JuanDtM23's avatar
JuanDtM23
Helper II
5 years ago
Solved

Formula de excel a Power BI

Best regards! I hope you can help me. I have the following information: Date Accumulated Revenue Revenue projection t+1 one-19 $ 118.325.626.888,57 $ 114.731.021.865,40 feb-19 ...
  • V-lianl-msft's avatar
    5 years ago

    Hi JuanDtM23 ,

     

    First, you need to split year and month in number format in the query editor.

    Then create measure like this:

    Measure = 
     var current_month = MAX('Table'[Month])
     var current_year = MAX('Table'[Year])
    var no_month_1 =  CALCULATE(SUM('Table'[Accumulated Revenue])+SUM('Table'[Revenue projection t+1]),FILTER(ALL('Table'),'Table'[Year]=current_year&&'Table'[Month]=current_month-1))
    return IF(current_month=1,SUM('Table'[Revenue projection t+1]),no_month_1)

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.