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 / Filter DB data and get...
Power Apps
Unanswered

Filter DB data and get data in horizontal gallery

(0) ShareShare
ReportReport
Posted on by

Hi , i have scenario where i have few rows in my SQL DB in that few file names and PageTitle will be same. I need to filter it through file name and display them in horizontal gallery if any file name having 2 rows in DB in gallery also i need in 2 rows. I'm providing my sample input and output below.

 

Input data from DB

 

DocName PageNo PageTitle ItemName ItemValue 

Image.pdf    3         Bill          Quantity     3 00      

Image.pdf    3         Bill          Amount     500

Image.pdf    3         Bill          Type           Water

Image1.pdf   3         kret         Quantity     8 00      

Image1.pdf   3         Kret         Amount     100

Image1.pdf   3         Kret         Type           null

Image.pdf    3         Bill          Quantity     6 00      

Image.pdf    3         Bill          Amount     300

Image.pdf    3         Bill          Type           Oil

 

 

Output needed in horizontal gallery if i filter it through Docname: 

 

Quantity    Amount    Type

3 00           500           Water

6 00           300            Oil

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @PrathapReddy1 ,

    This will get the data you need - you will need to add the headings as labels - it will also be a horizontal gallery in the layout you posted

    AddColumns(
     GroupBy(
     Filter(
     TableName,
     DocName = YourChosenValue
     ),
     "ItemName",
     "Data"
     ),
     "Quantity",
     CountRows(Data),
     "Amount",
     Sum(
     Data,
     ItemValue
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CU06020423-0 Profile Picture
    on at

    Hi @WarrenBelz  I'm getting error when i apply this code. I changed my DB name and column names. Is there anything i need to modify in this code.

  • CU06020423-0 Profile Picture
    on at

    @WarrenBelz giving errors near Group by And Sum places it's showing having invalid aruguments

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @PrathapReddy1 ,

    Please see amended post

  • CU06020423-0 Profile Picture
    on at

    Hi @WarrenBelz  I'm new to powerApps not able to make code through that reference. Can you help me with this what i need to modify in that to resolve that error.

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @PrathapReddy1 ,

    I assume you have replaced YourChosenName with your actual reference to the data you want to compare. What is the exact code (in Text) you are using and what result is it producing ?

  • CU06020423-0 Profile Picture
    on at

    @WarrenBelz it is showing me error like Groups having invalid aruguments and SUM also having some invalid aruguments 

  • CU06020423-0 Profile Picture
    on at

    .

  • CU06020423-0 Profile Picture
    on at

    Hi @WarrenBelz  this is my table with actual details

     

     

    IMG_20230424_111956.jpg

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @PrathapReddy1 ,

    That is nothing like my amended post structure

    AddColumns(
     GroupBy(
     Filter(
     Test1,
     DocName = "Filel"
     ),
     "VendorName",
     "Data"
     ), 
     "Quantity",
     CountRows(Data),
     "Amount",
     Sum(
     Data,
     Weight
     )
    )

     

     

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard