Skip to main content

Notifications

Power Apps - AI Builder
Answered

Power Apps Pie Chart list content display error

Posted on by 370
Hi All,
 
Please help with the correct syntax to display content from the SharePoint list column called: "Business unit change owner".
 
I am using "edit form" to show the fields in PowerApps and the field in question shows as: "Business unit change owner (Dept name)_DataCard1_2"
 
The field shows Business Units only; I need them shown in the pie chart, and the colors reflect the number of times a business unit is mentioned.
 
The syntax below is not working:
AddColumns(
    GroupBy(
        'CREQE_Form',
        "Business unit change owner",
        "Grouped Departments"
    ),
    "TotalIDbyDepartments",
    Sum(
        'Grouped Departments',
        'ID'
    )
)
 
Currently, the pie item property has a list name: CREQE_Form:
 
 

 
 
The chart must show a business unit once and the sum of each unit in color.
 
 
 
 
 
 
 
Categories:
  • Verified answer
    NN-21081740-0 Profile Picture
    NN-21081740-0 370 on at
    Power Apps Pie Chart list content display error
    It turned out I was using the incorrect field name. Though it says, " Business unit change owner", on the link of the field properties is says field = field_3 and therefore here is the correct syntax:
    ClearCollect(
        BusinessUnitCounts,
        AddColumns(
            GroupBy(
                'CREQE_Form',
                'field_3',
                "GroupedData"
            ),
            "Count",
            CountRows(GroupedData)
        )
    )
     
    Thanks a lot for your help.
  • WarrenBelz Profile Picture
    WarrenBelz 140,719 on at
    Power Apps Pie Chart list content display error
    You need single quotes around 'Grouped Departments' in both places
  • Suggested answer
    NN-21081740-0 Profile Picture
    NN-21081740-0 370 on at
    Power Apps Pie Chart list content display error
     
    I have tried the syntax: 
    AddColumns(
       GroupBy(
          'CREQE_Form',
          Business unit change owner,
          Grouped Departments
       ),
       TotalIDbyDepartments,
       CountRows('Grouped Departments')
    )
     
    But this is the error I got: Invalid number of arguments: received 2, expected 3 or more.
    We expect an operator such as +, *, or & at this point in the formula.
  • WarrenBelz Profile Picture
    WarrenBelz 140,719 on at
    Power Apps Pie Chart list content display error
    Firstly you do not need the quotes around the parameter, but to get the number if records in each group
    AddColumns(
       GroupBy(
          'CREQE_Form',
          Business unit change owner,
          'Grouped Departments'
       ),
       TotalIDbyDepartments,
       CountRows('Grouped Departments')
    )
     
    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    Buy me a coffee

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard