cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Gallery not showing all selected data from combo box

Hello All,

I have combo box wherein if i select Q1,Q2,Q3 data in the gallery is not summing the data and showing in the gallery.

It just shows only for one Q1 even if i select multiple quarters. Please advise.

 

Formula used in the gallery is :

 

If(type.Selected.Result = "All" ,Sum(Filter(MyCombinedTable,'Qty/Value'= "Qty",'Company Name'=inpcompanyname.Text,Year='from year'.Selected.Result,'Quarter No.'= quarter.Selected.Result),Value),Sum(Filter(MyCombinedTable,'Qty/Value'= "Qty",'Company Name'=inpcompanyname.Text,Year='from year'.Selected.Result,'Quarter No.'=quarter.Selected.Result,Type1=type.Selected.Result),Value))

 

nagaraj007_0-1596446003795.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Gallery not showing all selected data from combo box

Hi @nagaraj007 ,

I formatted your formula below for readability using the </> button in the toolbar:

If(
    type.Selected.Result = "All" ,
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'= quarter.Selected.Result
        ),
        Value
    ),
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'=quarter.Selected.Result,
            Type1=type.Selected.Result
        ),
        Value
    )
)

 

If I understand correctly, this means, "If the selected result for quarter (type) is "All", Sum up the combined table's value for all quarters, else sum it up for the filtered quarter." 

 

The Combo Box has two properties for selection:

  • Selected: this is the last record (row) that was selected from its items.
  • SelectedItems: this is the table of records (rows) that was selected from its items

 

The logic you are looking for is if Type1 is a member of the SelectedItems from the combo box.

The condition might look like this:

Type1 exactin type.SelectedItems.Result

 

Or in context:

If(
    type.Selected.Result = "All" ,
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'= quarter.Selected.Result
        ),
        Value
    ),
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'=quarter.Selected.Result,
            Type1 exactin type.SelectedItems.Result
        ),
        Value
    )
)

 

Note that checking for membership in a table is a heavy task--it's checking one table against another table whereas other conditions check one table to one value. If you're working with collections, it's negligible on performance still but if you're filtering against the connected data source directly, this filter may be non-delegable.

View solution in original post

1 REPLY 1
Highlighted
Power Apps
Power Apps

Re: Gallery not showing all selected data from combo box

Hi @nagaraj007 ,

I formatted your formula below for readability using the </> button in the toolbar:

If(
    type.Selected.Result = "All" ,
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'= quarter.Selected.Result
        ),
        Value
    ),
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'=quarter.Selected.Result,
            Type1=type.Selected.Result
        ),
        Value
    )
)

 

If I understand correctly, this means, "If the selected result for quarter (type) is "All", Sum up the combined table's value for all quarters, else sum it up for the filtered quarter." 

 

The Combo Box has two properties for selection:

  • Selected: this is the last record (row) that was selected from its items.
  • SelectedItems: this is the table of records (rows) that was selected from its items

 

The logic you are looking for is if Type1 is a member of the SelectedItems from the combo box.

The condition might look like this:

Type1 exactin type.SelectedItems.Result

 

Or in context:

If(
    type.Selected.Result = "All" ,
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'= quarter.Selected.Result
        ),
        Value
    ),
    Sum(
        Filter(MyCombinedTable,
            'Qty/Value'= "Qty",
            'Company Name'=inpcompanyname.Text,
            Year='from year'.Selected.Result,
            'Quarter No.'=quarter.Selected.Result,
            Type1 exactin type.SelectedItems.Result
        ),
        Value
    )
)

 

Note that checking for membership in a table is a heavy task--it's checking one table against another table whereas other conditions check one table to one value. If you're working with collections, it's negligible on performance still but if you're filtering against the connected data source directly, this filter may be non-delegable.

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,945)