Forum Discussion
Anonymous
4 years agoNot applicable
Stacking Accumulated Values, Legend Split by Year in a Line Graph
Hi - slightly tearing myself apart over this one - feels like i'm so close. Basically, I have the following table: id value year AsOfDate 1 45.34 2020 31 December 2020 2 44.10...
Ashish_Mathur
Super User
4 years agoHi,
I am not sure of what sort of a graph do you want but this is the approach you should follow:
- Create a Calendar Table with Year as a calculated column
- Build a relationship from the AsofDate column of the DailyPnL Table to the Date column of the Calendar Table
- To your visual, drag Year from the Calendar Table
- Write these measures
- Total = SUM(DailyPnL[Value])
- Total YTD = calculate([Total],datesytd(calendar[Date],"31/12"))
Hope this helps.
Anonymous
4 years agoNot applicable
Thanks Ashish. Unfortunately it didn't work. I get the same chart as above. I put the Date from my date table into the Axis as you said, the Year from the date table conditional column I had into the Legend and the PnL measure into the Values.
Just to clarify, each year should span across a year window period of time in the chart. So they should all be clumped together, and being accumulative, all be rising upwards together agains each month
- Ashish_Mathur4 years ago
Super User
Share the link from where i can download your PBI file.