Dear Experts,
It seems like I still do not understand some small things like distinct functions.
What could be the reason?
Osmand
Solved! Go to Solution.
What formula do you have on the Gallery items?
The Distinct formula should be on the Items of the Gallery.
Then the Text of the Label inside the Gallery could be:
ThisItem.Result
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
I found it.
Filter(Distinct(AllOrderDetails,'Model Number'),ModelN.Text in Result.Value)
Osmand
Distinct() formula you would use to return a single column list with unique values. So in your case, you would do
Distinct(OrderDetails, 'Model Number')
This would return a list of Unique Model Numbers.
This you would use in a DropDown or ComboBox, so you can select one of more of the model numbers. Then this control you would use for example to filter a gallery.
What is your use case for which you like to use this formula?
@KroonOfficeSol Thank you for your quick reply.
I tried it but still the same. under the result I see as Record. But still the same error.
I am trying this under a Gallery with a label.
Osmand
use:
Distinct(OrderDetails,'Model Number')
More on Distinct:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-distinct
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
This is not logic to use in a gallery I would say. Tell us more about you goal and make some more screenshots from the gallery and controls.
This is my Inventory balance report. I am using a Gallery. Added a label to get the Model numbers from Orderdetails. But I want there are Distinct values. I can use the ThisItem option but that will give me all. (Duplicates)
Osmand
What formula do you have on the Gallery items?
The Distinct formula should be on the Items of the Gallery.
Then the Text of the Label inside the Gallery could be:
ThisItem.Result
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
In your case you could better use the GroupBy() formula. What this does is that it groups based on your Model Number, but nested for each Grouped Item a table for all the records which are held in the group (hope this makes sense).
This because you probably like to calculate the number of items, amount of costs or whatever you like to show.
Also you could then select an item to navigate to another screen and put a gallery there connected to the gallery,selected.GroupName. Which then will return a table of the records which were grouped with the model number.
Distinct() you only use when you want to have a single column list on a dropdown or combobox.
Hope this helps.
@eka24 Thank you it is working fine, but on the other hand i lost my search option. How can I include the serach capabilities while having the Distinct option
Osmand
I found it.
Filter(Distinct(AllOrderDetails,'Model Number'),ModelN.Text in Result.Value)
Osmand