Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
miwundu
Helper I
Helper I

Help with SSRS Expression

I have 2 datasets in my report but using a common table. dataset 1 is named XXX and dataset 2 is named UNKNOWN . I have a column cell_1 with this ssrs lookup expression from dataset XXX

=Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX") and

 another column cell_2 from Unknown dataset with this expression 

Sum(Fields!total_complete_1_Count.Value) + Sum(Fields!total_complete_2_Count.Value) + Sum(Fields!total_complete_3_Count.Value).

 

I want to divide cell_1 by cell_2.  XXX EXPRESSION DISPLAYS correctly but unknown displays a wrong value

=Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX") / 

Sum(Fields!total_complete_1_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_2_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_3_Count.Value, "UNKNOWN").
The value for cell displays correctly but cell 2 does not so the result is wrong. I have also tried to use the numerator and denominator in text boxes properly named and then call them in this expression
=CD(Reportitems!XXX_Sum.Value) / CD(Reportitems!UNKNOWN_Sum.Value). 

THESE ARE THE TEXT BOX NAMES XXX_Sum AND UNKNOWN_Sum.

I am not sure what I am doing wrong

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @miwundu 

Based on the expression you provided, I created the following sample data:

vjianpengmsft_0-1723002659480.png

In Report builder I have the following two Dataset:.

vjianpengmsft_1-1723002688686.png

I use the following expression to find dataset xxx.

=Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX")

vjianpengmsft_2-1723002727452.png

I use the following expression to find dataset xxx and dataset UNKNOWN:

= (Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX")) / 
  (Sum(Fields!total_complete_1_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_2_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_3_Count.Value, "UNKNOWN"))

vjianpengmsft_3-1723002815175.png

The results are as follows:

vjianpengmsft_4-1723002843578.png

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @miwundu 

Based on the expression you provided, I created the following sample data:

vjianpengmsft_0-1723002659480.png

In Report builder I have the following two Dataset:.

vjianpengmsft_1-1723002688686.png

I use the following expression to find dataset xxx.

=Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX")

vjianpengmsft_2-1723002727452.png

I use the following expression to find dataset xxx and dataset UNKNOWN:

= (Sum(Fields!total_complete_1_Count.Value, "XXX") + Sum(Fields!total_complete_2_Count.Value, "XXX") + Sum(Fields!total_complete_3_Count.Value, "XXX")) / 
  (Sum(Fields!total_complete_1_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_2_Count.Value, "UNKNOWN") + Sum(Fields!total_complete_3_Count.Value, "UNKNOWN"))

vjianpengmsft_3-1723002815175.png

The results are as follows:

vjianpengmsft_4-1723002843578.png

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.