I've created the collection as you said but the last step doesn't work.. I want to filter the Division (it's a column in the lists) but when I use the your last formula there's nothing to select.
What am I doing wrong?
Hi @VS123 ,
I have to date been addressing your original issue with this formula
Distinct(Filter(If(CountryLabel.Text = 'Indonesia', 'Prices Indonesia', 'Prices Thailand'), CountrySystem = CountryLabel.Text).Division, Division)
The last step of the process I suggested will get you the correct "Prices xxxx" for the user.
So, is Division in the same list as 'Prices xxxxx' and you want a list of the matching Division entries for the User's Country?
Hi @VS123 , as the indonesia and thailand lists are created by you, we suggest you remove the duplication before creating the lists.
but if you insist, you may still distinct the value in powerapps as below formular:
Title is the column name, should be replaced with yours
I can't avoid the duplication, as the same division consists of multiple systems, which I want to filter in the second box.
I attached a screenshot of the Thailand list to make it more clear (every country list will look like that).
So in the first box I want to filter the Division (A or B) from a list which will be based on the user's country.
In the second box I want to filter based on the Division selected in box 1 the system.
As last step there will appear charts with the Prices for the different types of the selected system.
The first ComboBox with the distinct and switch is working, just now I'm facing the problem that I want to use the list I used for this ComboBox again in the next ComboBox where I want to filter based on the selected Division. Using the switch function again in the filter function is not working.
I've tried following:
Distinct(Filter(Switch(CountryLabel.Text, "Indonesia", 'IB Pricelist'.Division, "Thailand", 'Prices Thailand'.Division), Division = ComboBoxBusinessLine_3.Selected.Result), System)
Hi @VS123 ,
If you break your code down, you may see the issue.
Distinct( Filter( Switch( CountryLabel.Text, "Indonesia", 'IB Pricelist'.Division, "Thailand", 'Prices Thailand'.Division ), Division = ComboBoxBusinessLine_3.Selected.Result ), System )
You need to go from the inside out - so looking at the Switch, the two possible results are
Going with the first one for instance, your formula becomes
Distinct( Filter( 'IB Pricelist'.Division, Division = ComboBoxBusinessLine_3.Selected.Result ), System )
You are filtering a field instead of a list - I think it should be
Distinct( Filter( 'IB Pricelist', Division = ComboBoxBusinessLine_3.Selected.Result ), System )
So the end result would be
Distinct( Filter( Switch( CountryLabel.Text, "Indonesia", 'IB Pricelist', "Thailand", 'Prices Thailand' ), Division = ComboBoxBusinessLine_3.Selected.Result ), System )
I have not revisited anything else on this - I just thought this might help
Check out these cool Power Apps & vote on your favorite!
Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)
Check out whats happening in Power Apps
FIll out a quick form to claim your community user group member badge today!