0

I want sum of only unique values in SSRS report.Is there any logic to achieve this. this is what something like this sum(distinct value)

Thanks

2

2 Answers 2

3

Supposed you have a column named value in your query, you could do the following:

Add an additional column to the query of the dataset:

ROW_NUMBER() OVER (PARTITION BY [value] ORDER BY [value]) AS valueNr

Then, if you already have created a Sum field in the table, change the expression of the textbox to

=Sum(Iif(Fields!valueNr.Value=1, Fields!value.Value, 0))

Repeat this for every "distinct sum" calculation.

0

Yes. You use groups. At the top click the insert menu, then table, then Table Wizard. Pick your dataset and hit next. Now drag the column for the different types of items you want a distinct sum of into the Row Groups section. Drag your count column into the Values section. This should automatically turn it into Sum(ColumnName). You can click the down arrow to change the aggregate type (if desired). Press next and next and finish. Viola. You have a distinct sum for each specified field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.