Forum Discussion
Cumultive data for 3 different years on the same graph
- 4 years ago
If I add The Year column in the legend, I get :
For year 2020, it cumulates the numbers of 2019 and 2020.
As I don't want to cumulate, amitchandak suggested to create 3 measures :YTDnb = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD('Calendar'[Date],"12/31"))YTDnb-1 = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD(dateadd('Calendar'[Date],-1,Year),"12/31"))YTDnb-2 = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD(dateadd('Calendar'[Date],-2,Year),"12/31"))and then I get the good result :Thanks to you rsbin and to amitchandak for your great help ...
Hi jsteffe ,
You can try
Measure = SUMX (
FILTER (
ALLSELECTED ( Table1[Date] ),
Table1[Date] <= MAX ( Table1[Date] )
),
[Total Participant]
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- jsteffe4 years ago
Helper III
Thanks for your reply.
It partially works because with this measure, I get the following graph and using my segments, I can see the graph for each year.But how can I get the 3 curves on the same graph (one for 2019, one for 2020, one for 2021) ?
- rsbin4 years ago
Community Champion
- jsteffe4 years ago
Helper III
If I add The Year column in the legend, I get :
For year 2020, it cumulates the numbers of 2019 and 2020.
As I don't want to cumulate, amitchandak suggested to create 3 measures :YTDnb = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD('Calendar'[Date],"12/31"))YTDnb-1 = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD(dateadd('Calendar'[Date],-1,Year),"12/31"))YTDnb-2 = CALCULATE(SUM(Stages[nbParticipants]),DATESYTD(dateadd('Calendar'[Date],-2,Year),"12/31"))and then I get the good result :Thanks to you rsbin and to amitchandak for your great help ...