Hi guys,
I have made comprehensive application by taking inputs from one SharePoint list (Inputs list for my dropdowns) and patch data for repository into another SharePoint list. Now as a last step, I want to make some graphs (Colunm Chart). The problem I am facing is the structure of data stored in SharePoint list. I want to draw a column chart that will displayed the status of two KPIs (STD & LTD) based on Unit e.g. Unit-1 has two STDs, Unit-2 has zero STD and Unit-3 has 4 LTD. However, the data present in sharepoint list is in a status column against each Unit e.g Unit-1 has STD, Unit-2 has LTD etc. rather than count. Please look at the attchment to better understand this.
Can someone please help me how to transform this data. I am attaching the screenshot of existing data structure and desired data structure. Any workaround would be appreciated!
Existing Date in SharePoint ( there are many columns, i only showed columns of interest)

This is what I think the data should be organized in order to produce the desire column chart:

This is the desired column chart I want:
