Solved

SSRS Graph - Stacked Bar

Posted on 2016-08-17
2
80 Views
Last Modified: 2016-08-22
I am trying to create a Stacked Bar Graph in SSRS - i have the below data

Month      Q1              Q2               Q3               Q4
May            50.00%      20.00%      30.00%      0.00%
June            38.46%      30.77%      15.38%      15.38%
July            30.77%      38.46%      15.38%      15.38%
August  46.15%      7.69%      15.38%      30.77%

I want to have the stack by Q1 then the data be for each month, then Q2,Q3, Q4 and so on, I can easily do it in Excel (attached example) but cant reproduce in SSRS - hoping someone can help

Thanks

Book1.xlsx
0
Comment
Question by:dkilby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
Nico Bontenbal earned 500 total points
ID: 41764254
I'm afraid that's not possible in SSRS. So you need to reformat your data so the columns are Month, Quarter, Value. If you use SQL Server you can do that using UNPIVOT. Suppose your original query was like this:
select 'May' as Month, 50 as Q1, 20 as Q2, 30 as Q3, 0 as Q4
union all
select 'June' as Month, 38 as Q1, 30 as Q2, 15 as Q3, 15 as Q4
union all
select 'July' as Month, 30 as Q1, 38  as Q2, 15 as Q3, 15 as Q4
union all
select 'August' as Month, 46 as Q1, 7 as Q2, 15 as Q3, 38 as Q4

Open in new window

(That's not what your query looks like of course, but the result has the same structure as your example.) Then you can move the 4 quarters into 1 column like this:
select Month, Quarter, Value  from 
(
select 'May' as Month, 50 as Q1, 20 as Q2, 30 as Q3, 0 as Q4
union all
select 'June' as Month, 38 as Q1, 30 as Q2, 15 as Q3, 15 as Q4
union all
select 'July' as Month, 30 as Q1, 38  as Q2, 15 as Q3, 15 as Q4
union all
select 'August' as Month, 46 as Q1, 7 as Q2, 15 as Q3, 38 as Q4
) as original
UNPIVOT (Value for Quarter IN (Q1, Q2, Q3, Q4)) as new

Open in new window

With this result you can create a chart using Value as Values, Quarter as Category Groups and Month as Series Groups.

Please let me know if you need any further help solving this issue.
0
 

Author Closing Comment

by:dkilby
ID: 41766189
Thanks, worked perfectly
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question