cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
msequeira94
Advocate I
Advocate I

Galley with pie charts

Hi!

 

I'm trying to build a gallery with pie charts inside, screenshot below:

 

2019-07-08_10-40-40 - Apps.jpg

But the legends for the second and thrird items are not correct and i don't know why because the first one seems perfect.
Anyone can help me with this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @msequeira94 ,

Based on the issue that you mentioned, I think you have some misunderstanding with formula I provided above.

 

On your side, please consider modify your formula as below:

Set the Items property of the your Gallery to following formula:

[
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                         "ReviewersList",
                         "Group"
                       ),
               "LabelColumn",             /* <-- Add this new column, then set the Labels property of your Pie Chart control to this column */
               ReviewersList,            /* <-- Modify here. Type ReviewersList column here rather than "ReviewersList" */
               "Number",
               CountRows(Group)
  ),
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                          "ProjType",
                          "Group"
                       ),
                "LabelColumn",
                ProjType,      /* <-- Modify here. Type ProjType column here rather than "ProjType" */
                "Number",
                CountRows(Group)
  ),
  AddColumns(
                 GroupBy(
                           'DEMAND-DM',
                            "Category",
                            "Group"
                       ),
                "LabelColumn",
                 Category,     /* <-- Modify here. Type Category column here rather than "Category" */
                 "Number",
                 CountRows(Group)
  )
]

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @msequeira94 ,

Could you please share a bit more about the data structure of your 'DEMAND-DM' data source?

 

Based on the formula that you provided within the Items property of the Gallery control, I think there is something issue with it.

 

According to the formula you provided, I do not find any syntax error with it. Actually, this issue is related to the Pie Chart control you embedded within your Gallery control.

When you add a Pie Chart control within your Gallery, you could only set the Labels property and Series property to specific column value in your Table, you could not dynamically set the Labels property and Series property of the Pie Chart control to column value in your Table.

E.G. When you set the Labels property of the Pie Chart control to "ReviewersList" and set the Series property to "Numero" column, then all Pie Charts in your Gallery would show "ReviewersList" and "Numero" value as your first Pie Chart. For your second Pie Chart and third Pie Chart, it would not dynamically select "ProjType" or "Category" column as Labels property.

 

As an fixed solution, please consider take a try with the following workaround (Use a same column within your Table as the Labels property of your Pie Chart control😞

Set the Items property of the your Gallery to following formula:

[
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                         "ReviewersList",
                         "Group"
                       ),
               "LabelColumn",             /* <-- Add this new column, then set the Labels property of your Pie Chart control to this column */
               "ReviewersList",
               "Number",
               CountRows(Group)
  ),
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                          "ProjType",
                          "Group"
                       ),
                "LabelColumn",
                "ProjType",
                "Number",
                CountRows(Group)
  ),
  AddColumns(
                 GroupBy(
                           'DEMAND-DM',
                            "Category",
                            "Group"
                       ),
                "LabelColumn",
                 "Category",
                 "Number",
                 CountRows(Group)
  )
]

Then within your Gallery, set the Items property of the Pie Chart control to following:

ThisItem.Value

set the Labels property of the Pie Chart to following:

ThisItem.LabelColumn

set the Series proeprty of the Pie Chart to following:

ThisItem.Number

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-xida-msft ,

 

Thank you in advanced for your response.

I tried your solution and this was the outcome:

 2019-07-09_09-29-50.jpg

 

Not quite there. Here a sample of the data set (DEMAND-DM):

2019-07-09_09-35-25.jpg

 

Regards.

Hi @msequeira94 ,

Based on the issue that you mentioned, I think you have some misunderstanding with formula I provided above.

 

On your side, please consider modify your formula as below:

Set the Items property of the your Gallery to following formula:

[
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                         "ReviewersList",
                         "Group"
                       ),
               "LabelColumn",             /* <-- Add this new column, then set the Labels property of your Pie Chart control to this column */
               ReviewersList,            /* <-- Modify here. Type ReviewersList column here rather than "ReviewersList" */
               "Number",
               CountRows(Group)
  ),
  AddColumns(
                GroupBy(
                         'DEMAND-DM',
                          "ProjType",
                          "Group"
                       ),
                "LabelColumn",
                ProjType,      /* <-- Modify here. Type ProjType column here rather than "ProjType" */
                "Number",
                CountRows(Group)
  ),
  AddColumns(
                 GroupBy(
                           'DEMAND-DM',
                            "Category",
                            "Group"
                       ),
                "LabelColumn",
                 Category,     /* <-- Modify here. Type Category column here rather than "Category" */
                 "Number",
                 CountRows(Group)
  )
]

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

It's working perfectly! Thank you @v-xida-msft !

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (29,182)