web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sum of columns in labe...
Power Apps
Answered

Sum of columns in label text, based on data from two tables (SQL)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
Hi Community, I am currently looking at a gallery. In this gallery I have a Title and a Subtitle. The Title has data from the column 'Initiative' from the datasource 'Table1' (SQL). However, I am using a datasource called 'Table2' (also SQL) for the subtitle, which is supposed to Sum up the column 'Realized Savings', for all values connected to the same value in the 'Initiatives' column. Not to make too much confusion, there is also a column called 'Initiatives' in "Table2", and the values are identical to those of "Table1", except for the frequency, since 'table1' is sort of one level up in my overall project. So, so far I've written the following code: Sum(Filter('[dbo].[Table2]';Realized_Savings='Initiative');Initiative), It is accepted but has a blue wiggely line under it. Any idé of how I can continue with this? Or if I'll have to do something else in my original data? Thanks in advance!
Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    So the situation is:
    You have two table, table1 and table 2, both has a column named to  'Initiative', 

    and within the Galley, the Title1 Label has been configured to  'Initiative' under Table1, and for the SubTitle, you would like to sum up the 'Realized Savings' from Table 2, for all the 'Initiative' column value equals to the one configured under the Title1 from Table1,

    If this is what you would like to achieve, then please take a try to switch the formula as blow:

     

    Sum(Filter('[dbo].[Table2]';Initiative=Title1.Text);Realized_Savings)

    The column name for "Realized Savings" might be different from the above, please consider select the proper one from the Dropdown when writing the formula.

     

    Let me know if that would work as expected.

     

    Regards,

    Michael

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Michael,

     

    It worked exactly as I wanted. Thank you very much.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard