Forum Discussion
Need help with YOY line chart
- 3 years ago
Anonymous
you can create a scope column, then only do the calculation when scope is y
pls see the attachment below
ryan_mayu Sorry for the late reply. This is exactly the format I was looking for. I need one additional thing changed and need your help with. My current data is looking YTD and ends last Sat. So for the current report, it should have data from 1/1/23 - 9/2/23. I want the PY to be compare the same time period(Week) so itd be 1/2/22 - 9/3/22 if that makes sense.
- ryan_mayu3 years agoSuper User
Anonymous
you can create a scope column, then only do the calculation when scope is y
pls see the attachment below
- Anonymous3 years agoNot applicable
ryan_mayu Excellent!! This is exactly what I was looking to do. Thanks a lot for all your help!
- ryan_mayu3 years agoSuper User
you are welcome
- Anonymous2 years agoNot applicable
ryan_mayu Hello I have one more question. Similar to here where you helped me get yoy data for same date time. How would the forumla change if I'm bringing one more year(2021) I'm looking to compare same timeframe for current year, Previous year and PPY.
'
scope =VAR _year=year('Table'[Week End])VAR _py=EDATE(TODAY(),-12)RETURN IF(_year=YEAR(TODAY()) || _year=year(today())-1 && 'Table'[Week End]<=_py,"y")'
I'm struggling to add the forumla for the PPY- ryan_mayu2 years agoSuper User
Anonymous
maybe you can try this
scope =VAR _year=year('Table'[Week End])VAR _py=EDATE(TODAY(),-12)VAR _ppy=EDATE(TODAY(),-24)RETURN IF(_year=YEAR(TODAY()) || _year=year(today())-1 && 'Table'[Week End]<=_py||_year=year(today())-2&&'Table'[Week End]<=_ppy,"y")