Naveen
Naveen

Reputation: 360

SSRS - Barchart with 3 values - (One bar should highlight 2 values and remaining one on other bar)

I am trying to make a bar chart to represent the logging hours of an employee. is it possible through SSRS ??

Here is a sample database structure and values , I want the "Name" in X axis and Y axis can be the Hours.

enter image description here

Upvotes: 0

Views: 37

Answers (1)

niktrs
niktrs

Reputation: 10066

One workaround is creating a cross join in your query to create a dummy grouping for the stacked bar chart.

My sample Dataset:

SELECT 
    name,
    CASE WHEN chartgroup = 1 THEN estimated END AS estimated,
    CASE WHEN chartgroup = 2 THEN actual END AS actual,
    CASE WHEN chartgroup = 1 THEN diff END AS diff,
    chartgroup

FROM (
    select 'alan' as name, 120 as 'estimated', 138 as 'actual',  50 as diff 
    union all
    select 'elsa' as name, 130 as 'estimated', 162 as 'actual',  38 as diff 
) d
CROSS JOIN
(
    SELECT 1 AS chartgroup
    UNION ALL
    SELECT 2 
) c

Create your chart to group on name and the dummy group like in the image below

enter image description here

Your result will look like as the image below

enter image description here

Upvotes: 2

Related Questions