I would like to create a measure or calculated column where I combine data based on period data from another table with the conditition that IF the Actuals[period] occurs in the below table (ytd period), it should take the actuals of ACTUALS. If the period doesn't appear in ytd period, it should take the period and actuals of LE.
End result :
I hope that is clear and that you can help me in the right direction 🙂
Thank you for accepting my solution ! Please raise one ticket per problem and dont add on extra questions. Thanks 😀😀😀 You will get a faster replies, it is less for solvers for read and each solver gets the kudos they deserve.
It is best practice to user Calendar tables rather than try build your own DAX date logic like YTD. Novices get themselves into a complex spaghetti DAX mess. Whereas Calendars are simple and perform much better.
In a Calendar table you can have offsets for days, months, quarters and years.
So YTDsales = CALCULATE( SUM(Sales[value]), Calendar[yearoffset) = 0 )
So LYsales = CALCULATE( SUM(Sales[value]), Calendar[yearoffset) = -1 )
Here are some free Calandar training videos which you must do if you want to use Power BI professionally.
It will take a few hours but a good investment of your time !