Charts - Multiple Categories

Brett Ossman 51 Reputation points
2022-12-08T20:14:31.663+00:00

I want to create a column chart where each bar has distinct counts.
For example:

Bar 1: Count items with Priority 1
Bar 2: Count items with Priority 2

now the tricky part, I think:

Bar 3: Count items produced by company X of any Priority (not just 1 or 2)
Bar 4: Count items produced by company Y of any Priority (not just 1 or 2)
Bar 5: Count items available within 2 weeks from ANY company (not just X or Y) or Priority (not just 1 or 2)

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.
3,056 questions
{count} votes

Accepted answer
  1. Anonymous
    2022-12-13T02:21:14.63+00:00

    Hi @Brett Ossman
    First insert a Column Chart. Double-clicking on the chart will bring up a window for setting the chart data. Please remove the Details in Category Groups, and we add expressions directly in the Values window.
    269836-3.png
    First add the first expression with count Priority=1: =Sum(iif(Fields!Priority.Value=1,1,0), "DataSet1").
    269808-4.png
    For the convenience of observation, we select Custom legend text in the Legend window and fill in "Priority=1".
    269852-5.png
    Click OK, it will be as shown in the picture, we can click "Show data label" to display the result of the expression.
    269844-6.png
    We can add the rest of the tags in turn as above.

    Priority=2:  
    =Sum(iif(Fields!Priority.Value=2,1,0), "DataSet1")  
      
    Company=X:  
    =Sum(iif(Fields!Company.Value="X",1,0), "DataSet1")  
      
    Company=Y:  
    =Sum(iif(Fields!Company.Value="Y",1,0), "DataSet1")  
      
    2weeks:  
    =Sum(iif(DateDiff(DateInterval.Weekday,Fields!Date.Value,today() )<2,1,0), "DataSet1")  
    There is a difference between DateInterval.Weekday and DateInterval.WeekOfYear, you can choose the result you want to achieve.  
    

    269756-7.png
    Preview:
    269790-8.png
    Best regards,
    Aniya

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Joyzhao-MSFT 15,631 Reputation points
    2022-12-09T02:39:04.733+00:00

    Hi @Brett Ossman ,
    What data and fields does your original table contain? What does your chart look like currently?
    I will do some tests if you could provide some test data.
    Best Regards,
    Joy


  2. Brett Ossman 51 Reputation points
    2022-12-09T11:44:59.567+00:00

    Here's a simpler one that would probably point me in the right direction.

    A table of first and last names. One field/column for each.

    Create one chart that has three columns.
    Column 1: Counts names = Sam
    Column 2: Counts names = Granger
    Column 3: Counts names = Brad Johnson


  3. Brett Ossman 51 Reputation points
    2022-12-12T11:31:45.637+00:00

    Yes,
    That's what I'm after.

    How do I chart that?

    0 comments No comments

  4. Brett Ossman 51 Reputation points
    2022-12-13T11:33:56.117+00:00

    Thanks
    The Values list was key for me.
    I thought I tried that, but obviously got something wrong.
    Thanks again.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.