SSRS report - 100% stacked bar base on one column

mark goldin 691 Reputation points
2021-07-29T17:51:35.853+00:00

I need to show a chart like this:

119164-image.png

Can I show it with this data:

Name Count

ABC 30

where green is 30% and black is 70% to make it 100%.

Thanks.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,878 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 43,246 Reputation points
    2021-07-30T06:12:29.12+00:00

    One way is to calculate the rest up to 100 already in the SQL query.
    Imagine "test" is your table with the figures, then this should work.

    ;with test as
        (select 'ABC' AS Name, 30 AS Cnt)
    
    SELECT *
    FROM test
    
    UNION ALL
    
    -- Calculate the rest up to 100
    SELECT 'ZZZ',
           100.0 - (SELECT SUM(cnt) FROM test)
    
    0 comments No comments

0 additional answers

Sort by: Most helpful