I am trying to create a 100% stacked bar chart to display totals I have of various counts I'm getting through a query. I cannot figure out how to use the grouping the allow the y axis of the chart to display the different column names of the totals I have. I have created what I want in separate charts but because the way html formats everything there is a bunch of unwanted spacing and I'm trying to create this in one chart. Example below
In this I am just getting the sum of the column I have which is returning a 1 or 0 for each item based on the status. Then for the remaining 100% I'm using an expression to subtract them from a total.
=Sum(Count(Fields!Computer_Name.Value)) - Sum(Fields!ClientHealthEvaluation.Value)
I can modify my query to group all this in the results and just have a query of the totals but I still haven't found a way to make that work in one bar chart either. I would like to know if there is a way to have all this displayed in one bar chart, y axis groups are the separate columns, bars showing the totals so its cleaner or at least to know of a better way to structure all these separate charts in the image so they look more uniform. Is this possible?
--Edit - Adding sample of dataset
resourceID IsActiveDDR IsActivePolicyRequest IsActiveStatusMessages IsActiveHW IsActiveSW ClientHealthEvaluation
16784171 0 0 0 0 0 1
16784668 1 1 1 1 0 1
16784901 0 0 0 0 0 1
16785366 1 0 1 0 0 1
16786781 0 0 0 0 0 1
16786855 0 0 0 0 0 1
16787070 1 1 1 0 0 1
16787571 0 0 0 0 0 1
16787996 1 1 1 1 0 0
16788182 1 1 1 1 0 1
This is the data i currently have and i use sum function on each column to get the totals. I can group this like below if its easier.
Total IsActiveDDR IsActivePolicyRequest IsActiveStatusMessages IsActiveHW IsActiveSW ClientHealthEvaluation
10 5 4 5 3 0 9
---Edit: Updated dataset as suggested to now format the table in a way that will work better with a chart.
select
'Client Health Evaluation' as 'PolicyType',
'Success' as 'Status',
SUM(a.ClientHealthEvaluation) as 'Amount'
from(
Select
summ.Resourceid,
case summ.LastEvaluationHealthy when 1 then 1 else 0 end as 'ClientHealthEvaluation'
from v_CH_ClientSummary summ) a
UNION
select
'Client Health Evaluation' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.ClientHealthEvaluation)) as 'Amount'
from(
Select
summ.Resourceid,
case summ.LastEvaluationHealthy when 1 then 1 else 0 end as 'ClientHealthEvaluation'
from v_CH_ClientSummary summ) a
-------------
UNION
select
'Policy Request' as 'PolicyType',
'Success' as 'Status',
SUM(a.IsActivePolicyRequest) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActivePolicyRequest
from v_CH_ClientSummary summ) a
UNION
select
'Policy Request' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.IsActivePolicyRequest)) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActivePolicyRequest
from v_CH_ClientSummary summ) a
-------------
UNION
select
'Data Discovery' as 'PolicyType',
'Success' as 'Status',
SUM(a.IsActiveDDR) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveDDR
from v_CH_ClientSummary summ) a
UNION
select
'Data Discovery' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.IsActiveDDR)) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveDDR
from v_CH_ClientSummary summ) a
-------------
UNION
select
'Hardware Inventory' as 'PolicyType',
'Success' as 'Status',
SUM(a.IsActiveHW) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveHW
from v_CH_ClientSummary summ) a
UNION
select
'Hardware Inventory' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.IsActiveHW)) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveHW
from v_CH_ClientSummary summ) a
-------------
UNION
select
'Software Inventory' as 'PolicyType',
'Success' as 'Status',
SUM(a.IsActiveSW) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveSW
from v_CH_ClientSummary summ) a
UNION
select
'Software Inventory' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.IsActiveSW)) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveSW
from v_CH_ClientSummary summ) a
-------------
UNION
select
'Status Messages' as 'PolicyType',
'Success' as 'Status',
SUM(a.IsActiveStatusMessages) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveStatusMessages
from v_CH_ClientSummary summ) a
UNION
select
'Status Messages' as 'PolicyType',
'Failure' as 'Status',
(Count(a.resourceid) - SUM(a.IsActiveStatusMessages)) as 'Amount'
from(
Select
summ.Resourceid,
summ.IsActiveStatusMessages
from v_CH_ClientSummary summ) a
Order by PolicyType, Status desc
Output:
PolicyType Status Amount
ClientHealth Evaluation Success 13862
Client Health Evaluation Failure 210
Data Discovery Success 13967
Data Discovery Failure 105
Hardware Inventory Success 13854
Hardware Inventory Failure 218
Policy Request Success 14025
Policy Request Failure 47
Software Inventory Success 13713
Software Inventory Failure 359
Status Messages Success 14018
Status Messages Failure 54
Chart: