Solved

SSRS Graph - Stacked Bar

Posted on 2016-08-17
2
69 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 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