cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ReyOrtiz
Helper II
Helper II

Dropdown within Column Chart

Hi everyone,
Hope you all are doing well, I need some assistance with PowerApps specifically with charts. I have a list that I want to create a chart based on 2 columns. one column is called territory (North, South, West, and East) And I want those options to be on a dropdown, so when a territory is chosen the chart shows the issue categories from the other column. I tried and it comes back with all answers per territory instead of grouping them into the 5 categories that they are. For example, if I select North, I wanted to come back on the chart with issue1=# issue2=# issue3=#, etc. I searched around the site and could find anything that will help me add the answers per issue and present a column on the chart. So far, I tried the following,

 

Sort(Filter(CETroubleshooting_tracker,Territory  = Dropdown5.Selected.Result),Category)

for the chart and
Distinct(CETroubleshooting_tracker, Territory) for the dropdown (this one is working fine)

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi there @ReyOrtiz 

 

what does the data look like in the second column?  you will have to group the data and based on what you have in the second column either sum or count the data. 

 

for example

AddColumns(
    GroupBy(
        yourDataSource,
        "territory",
        "territories"
    ),
   "total for issue1",
    Sum(
        territories,
        issue1
    ),
    "total for issue2",
    Sum(
        territories,
        issue2
    ),
    "total for issue3",
    Sum(
        territories,
        issue3
    )
)

this will give you the total for issue1, 2 and 3

 

If you have a column which is populated issue 1 issue 2/3 then

AddColumns(
    GroupBy(
        Filter(yourDataSource, territory = yourComboBox.Selected.Result),
        "territory",
        "territories"
    ),
    "total issue 1",
    CountRows(
        Filter(
            territories,
            issues = "issue 1"
        )
    ),
    "total issue 2",
    CountRows(
        Filter(
            territories,
            issues = "issue 2"
        )
    ),
    "total issue 3",
    CountRows(
        Filter(
            territories,
            issues = "issue 3"
        )
    )
)

 

Result

Peek 2022-06-13 21-11.gif

 

Hope it helps,

R

View solution in original post

3 REPLIES 3
Ginko
Helper III
Helper III

Will these issues be static and predefined or be consistently changing/added/removed with user input?

rubin_boer
Super User
Super User

hi there @ReyOrtiz 

 

what does the data look like in the second column?  you will have to group the data and based on what you have in the second column either sum or count the data. 

 

for example

AddColumns(
    GroupBy(
        yourDataSource,
        "territory",
        "territories"
    ),
   "total for issue1",
    Sum(
        territories,
        issue1
    ),
    "total for issue2",
    Sum(
        territories,
        issue2
    ),
    "total for issue3",
    Sum(
        territories,
        issue3
    )
)

this will give you the total for issue1, 2 and 3

 

If you have a column which is populated issue 1 issue 2/3 then

AddColumns(
    GroupBy(
        Filter(yourDataSource, territory = yourComboBox.Selected.Result),
        "territory",
        "territories"
    ),
    "total issue 1",
    CountRows(
        Filter(
            territories,
            issues = "issue 1"
        )
    ),
    "total issue 2",
    CountRows(
        Filter(
            territories,
            issues = "issue 2"
        )
    ),
    "total issue 3",
    CountRows(
        Filter(
            territories,
            issues = "issue 3"
        )
    )
)

 

Result

Peek 2022-06-13 21-11.gif

 

Hope it helps,

R

Thank you @rubin_boer 

It worked like a charm thank you so much for the quick response. 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,412)