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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help Needed: Gallery t...
Power Apps
Unanswered

Help Needed: Gallery to Display Existing PMO Scorecard Records or Default KPI Definitions

(0) ShareShare
ReportReport
Posted on by 19
Hi all,

I’m currently building a Power Apps canvas app connected to three SharePoint lists:

PMO - Scorecard (stores user input)
PMO - Scorecard KPI Definition (contains predefined KPI metrics based on LoB/SubLoB)


Objective:

I want to display a gallery that shows:

1. Existing KPI entries from the PMO - Scorecard, based on parameters passed via the app (LoB, SubLoB, FY, Q, Region, Project Name).
2. Fallback KPI metrics from the PMO - Scorecard KPI Definition if no corresponding entries exist yet in the Scorecard — this allows users to input new data using the same interface.



Current Setup:

The gallery's Items property currently filters 'PMO - Scorecard' like this:


Filter(
    'PMO - Scorecard',
    'KPI Metric'.Id in
        ForAll(
            Filter(
                'PMO - Scorecard KPI Definition',
                ('LoB Applicability' = varLoB || 'LoB Applicability' = "All") &&
                ('SubLob Applicability' = varSubLoB || 'SubLob Applicability' = "All")
            ),
            ID
        ) &&
    'GPMO Project Name' = varProjName &&
    FY = varFY &&
    Quarter = varQ &&
    Region = varRegion
)

The label to display KPI Metric uses:
ThisItem.'KPI Metric'.Value

RAG is a lookup and uses:
ThisItem.RAG.Value

Rationale is a multi-line text input:
ThisItem.Rationale

Issue:

This works only when there is an existing record in 'PMO - Scorecard'.
If no record exists, the gallery is blank.

I want it to instead fall back to displaying KPI definitions (filtered by LoB/SubLoB), so users can enter the RAG and rationale against each expected KPI.


Attempted Fix:

I tried creating a ClearCollect() with AddColumns() to combine existing records and definitions, but I get delegation warnings and errors like:

"Expected identifier name"

"The function 'AddColumns' has some invalid arguments"


What I Need Help With:

A reliable way to display existing Scorecard entries or fallback definitions in the same gallery.

A formula for the KPI label that dynamically handles either source (Scorecard or KPI Definition).

Suggestions on how to structure the dropdowns and text inputs when the data might not yet exist.


Thanks in advance for any help or best practices you can share!
Categories:
I have the same question (0)
  • Suggested answer
    AmínAA Profile Picture
    1,228 Super User 2025 Season 2 on at
    Greetings @Manpowerapp!
     
    I'm not exactly picturing your App, so this might be tricky, but, if I understood correctly, it is that you want your gallery to show X thing if there are records in 'PMO - Scorecard' and in case there are no records, you want your gallery to show Y thing...
    If that’s right, then you have two ways of going about it:

    First, if the contents of the gallery are wildly different, like, the contents of X have nothing to do with the contents of Y regarding the columns they must show. It is easier to just have two galleries, and just switch between them, showing one or the other for each case.
     
    Second, this works for both if the contents are the same or wildly different, although it’s a pain in the ass to set up the contents are different. But you can just have some logic in the Items property of your gallery, check if there are any records in the 'PMO - Scorecard', and in case there are, you show X items, and in case there aren’t you show Y items. If the columns are the same for both tables, then it’s pretty much easy to set up, if they’re different, you’ll have to have logic for each individual control within the gallery, to account for this possibility.
     
    Hopefully I made myself clear and I made sense to you!

    If you like my response, please give it a Thumbs Up. Should this reply solve your question, please mark your post as Solved. Otherwise, feel free to reply to my answer for further help.
    Connect with me if you feel like it! 
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    Firstly @AmínAA's observations are correct - you need a "base" for you data set filter, which can be one table or the other, then compare that with the second table. You can however go "either direction", or in your case you could have a gallery for each - based on 'PMO - Scorecard'
    With(
       {
          _KPI:
          Filter(
             'PMO - Scorecard KPI Definition',
             ('LoB Applicability' = varLoB || 'LoB Applicability' = "All") &&
             ('SubLob Applicability' = varSubLoB || 'SubLob Applicability' = "All")
          )
       },
       Filter(
          'PMO - Scorecard',
          'KPI Metric'.Id in _KPI.ID &&
          'GPMO Project Name' = varProjName &&
          FY = varFY &&
          Quarter = varQ &&
          Region = varRegion
       )
    )
    and/or based on 'PMO - Scorecard KPI Definition'
    With(
       {
          _Scorecard:
          Filter(
             'PMO - Scorecard',
             'GPMO Project Name' = varProjName &&
             FY = varFY &&
             Quarter = varQ &&
             Region = varRegion
          )
       },
       Filter(
          'PMO - Scorecard KPI Definition',
          ID in _Scorecard.'KPI Metric'.Id &&
          ('LoB Applicability' = varLoB || 'LoB Applicability' = "All") &&
          ('SubLob Applicability' = varSubLoB || 'SubLob Applicability' = "All")
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard