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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PeteSil1020
Helper I
Helper I

Adding the Value of Two Textboxes in Separate Tables

Hello,

 

This issue has been driving me crazy, so if someone is able to come up with a solution I will be extremely thankful.

 

To give an overview of the issue, I am attempting to sum the values of two textboxes together, but that are in two different tables, and are using two different datasets. So simply doing ReportItems!Textbox10.Value + ReportItems!Textbox20.Value won't work.

 

Now diving into what these textboxes are made up of, this is the expression for Textbox10:

=SUM(
IIF(
DateAdd("m", 1, Parameters!Quarter.Value) = Fields!Exit_Date.Value,
                     Lookup(
                    Fields!Investment.Value,
                    Fields!Investment.Value,
                    Fields!Recallable_Amount.Value,
                    "SumInvestmentsMeasures"
                      ),
              0
          )
)

 

Textbox 20:

=SUM(
IIF(
DateAdd("m", 1, Parameters!Quarter.Value) = Fields!estimated_date.Value,
Lookup(
                           Fields!deal_name.Value,
                            Fields!deal_name.Value,
                             Fields!Discretionary_Reserves.Value,
                             "InvestmentReserves"
                    ) / 1000000,
             0
        )
)

 

If someone has an idea of how I can get the values of these two textboxs to be aggegated, it would be a saving grace.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PeteSil1020 ,

Create Custom Code Functions: You can write custom functions to aggregate your values.

Modify Your Textbox Expressions: Use the function within your existing expressions for Textbox10 and Textbox20 to add their values to the total. For example, for Textbox10, modify the expression.

=Code.AddToTotal(SUM(IIF(DateAdd("m", 1, Parameters!Quarter.Value) = Fields!Exit_Date.Value, Lookup(Fields!Investment.Value, Fields!Investment.Value, Fields!Recallable_Amount.Value, "SumInvestmentsMeasures"), 0)))

 

 To display the aggregated value, you can create another textbox and set its expression to . This textbox will display the sum of the values from Textbox10 and Textbox20.=Code.GetTotal().

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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 @PeteSil1020 ,

Create Custom Code Functions: You can write custom functions to aggregate your values.

Modify Your Textbox Expressions: Use the function within your existing expressions for Textbox10 and Textbox20 to add their values to the total. For example, for Textbox10, modify the expression.

=Code.AddToTotal(SUM(IIF(DateAdd("m", 1, Parameters!Quarter.Value) = Fields!Exit_Date.Value, Lookup(Fields!Investment.Value, Fields!Investment.Value, Fields!Recallable_Amount.Value, "SumInvestmentsMeasures"), 0)))

 

 To display the aggregated value, you can create another textbox and set its expression to . This textbox will display the sum of the values from Textbox10 and Textbox20.=Code.GetTotal().

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.