Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6801387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:05:38+00:00 2026-05-26T19:05:38+00:00

With this dataset: Category | Amount A | 5 A | 3 B |

  • 0

With this dataset:

Category | Amount
A        | 5
A        | 3
B        | 6
B        | 2
B        | 1
C        | 7

I want to create a tablix grouping on category, displaying the percentage of the total amount:

Category | Percentage
A        | 33%
B        | 38%
C        | 29%

Which should be a simple calculation:

Category | Percentage
A        | ((Sum of Amount within group / Sum of Amount across groups) * 100)%
B        | ((Sum of Amount within group / Sum of Amount across groups) * 100)%
C        | ((Sum of Amount within group / Sum of Amount across groups) * 100)%

But I can’t figure out how to do that within Report Designer (SSRS) – whenever I create a row grouping on Category, I can get the sum within the group with =Sum(Fields!Amount.Value). But how to get the sum across groups from a cell within the group?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:05:39+00:00Added an answer on May 26, 2026 at 7:05 pm

    I’ll answer my own question.

    From within any expression, it’s possible to perform lookups in all datasets. Through this way we’ll get the data:

    LookupSet(SourceFieldToCompare, TargetFieldToCompare, ResultField, DataSet)
    

    Now, let’s raise the bar for the question and say the data is grouped in yet another dimension, months – like this:

    Category | January | February | March
    A        | 33%     | 37%      | 35%
    B        | 38%     | 36%      | 37%
    C        | 29%     | 27%      | 28%
    

    Say the dataset mentioned in the question is named ‘categories’. Now, call on the LookupSet function (Reference):

    LookupSet(Fields!Month.Value, Fields!Month.Value, Fields!Amount.Value, "categories")
    

    (keep in mind that the first “Month” is linked to the dataset inside the tablix, and the second “Month” in the second argument is “Month” from the “categories” dataset!)

    There remains one problem: LookupSet returns Object types, which Sum won’t eat. You need to use a custom aggregate, (custom code is added in “Report Properties”): (Source)

    Function SumLookup(ByVal items As Object()) As Decimal
      If items Is Nothing Then
        Return Nothing
      End If
    
      Dim suma As Decimal = New Decimal()
      suma = 0
    
      For Each item As Object In items
        suma += Convert.ToDecimal(item)
      Next
    
      Return suma
    End Function
    

    Now, by calling Code.SumLookup on the LookupSet function the sum is calculated of all fields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a dataset with aggregated data and total values per category. Example: Now
I have a DataSet with some Datatables and I am saving this DataSet as
I'm using a web service that returns a dataset. in this dataset there are
I normally program in C++, so all this DataSource/DataSet/Binding stuff is confusing the hell
This is the code I have: Sub Main() Dim dts As New DataSet Dim
I just saw this topic: Datatable vs Dataset but it didn't solve my doubt
[...] public DataSet ReturnPromoMagazinesDs() { MySql.Data.MySqlClient.MySqlConnection mysqlConnection = new MySql.Data.MySqlClient.MySqlConnection(this.connectionString); MySql.Data.MySqlClient.MySqlCommand mysqlCommand = new
so this is a fragment of a procedure that exports a dataset from access
In this question, I asked about breaking a dataset into subsets, and got a
I have this code so I can grab the values ind the dataset before

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.