How to calculate the cumulative total for each year

I am using a dataset with the number of hires for each month, as shown below.(num: number of people hired in that month)

I would like to accumulate the number of hires for each year and display them for two years in a line graph as shown below.

I created a calculated field: #Cumulative, and set the X-axis to year and the value to #Cumulative for the line chart, but I get an error.

#Cumulative
runningSum(sum({num}),[date ASC],[year])

Is there a better way to fulfill my request?

Hi @Natsuki

Your calculation looks correct. What error are you getting?

Hi @mukilan

The following error message is displayed.
“Reference for table calculated attribute not found in field well.”

@Natsuki - Thank you for posting your query. As you can see from the error that it is complaining that the column reference is missing in the visual because the “year” field that you have used in the calculated field is not being used in the Line chart. Hence, I suggest that you modify your calculation to not use the native “year” column; rather you should use the extract function to extract the year from the "date "attribute itself. Please use the following calculation and that should give you the graph that you are looking for.

image

See the Line chart below for your reference. Hope this helps!

Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”. This will help the community to find guidance and answers to similar question. Thank you!