cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AsanKani
Helper V
Helper V

filter with collection

Hi Guys,

I have small trouble in Collection. Kindly support to resolved my problem.

First Collection Name as "GetStockIDFilter_MTR"
2nd Collection Name as "GetItemNumberTableDate_MTR"

First collection having ID's saved in Result.

 

ClearCollect(GetStockIDFilter_MTR,Distinct(Filter(Purchase_StockTable, Tool=true),ID).Result);

 

 

First collection each item id to matched (multiple matches available) in data source, that data needed in 2nd collection.


2nd Collection data source having multiples ID's.
2nd collection need to create with filter of first collection ID's. 

So, i am using below coding to create 2nd collection.

 

ClearCollect(GetItemNumberTableDate_MTR,ForAll(GetStockIDFilter_MTR, Filter(Purchase_ItemNumberTable, StockID = Result)));

 

 

But 2nd collection created in multiple table value. I need to use 2nd collection in Dropdown to show the Title. But this is not working.

I need to modified coding in 2nd collection to get without table collection data. Help to resolve. I have attached images for your information.

new request.JPGMicrosoftTeams-image (3).pngMicrosoftTeams-image (2).png

 

Thanks in Advance

1 ACCEPTED SOLUTION

Accepted Solutions
Alex_10
Super User
Super User

@AsanKani 

 

Clear(GetItemNumberTableDate_MTR);
ForAll(GetStockIDFilter_MTR As ThisNumber,
Collect(GetItemNumberTableDate_MTR, Filter(Purchase_ItemNumberTable, StockID = ThisNumber.Result))
)

 

 

View solution in original post

5 REPLIES 5
AsanKani
Helper V
Helper V

@RandyHayes , @WarrenBelz , @BCLS776  and @StalinPonnusamy   if you have time means help me. Thanks

StalinPonnusamy
Community Champion
Community Champion

Hi @AsanKani 

 

Looks like the First collection has more than 1 record since this is not looking for a specific record. For this reason, the second collection has multiple items. For each Id, it brings multiple records.

 

Are you expecting 1st collection has more than 1 record?

AsanKani
Helper V
Helper V

Sorry, @StalinPonnusamy  I think Myself -  I am not clear to explain.

See below image is first collection data...

AsanKani_0-1628004888201.png

and collection coding in below

 

 

ClearCollect(GetStockIDFilter_MTR,Distinct(Filter(Purchase_StockTable, Tool=true),ID).Result);

 

 

 

No issues in first collection. I need second collection without table format. My formula is need to improved to get second collection.. Second collection is having multiple items with multiple records.

second collection coding is below

 

 

ClearCollect(GetItemNumberTableDate_MTR,ForAll(GetStockIDFilter_MTR, Filter(Purchase_ItemNumberTable, StockID = Result)));

 

 

See StockID = Result (Result from first collection - GetStockIDFilter_MTR)

Now, second collection create like below

AsanKani_1-1628005134217.png

 

Here each second collection value having like below data. but i need all data in second collection value. not in table view.

AsanKani_2-1628005190394.png

 

I want second collection without table to use in dropdown it's Title

AsanKani_0-1628006157040.png

 

 

Alex_10
Super User
Super User

@AsanKani 

 

Clear(GetItemNumberTableDate_MTR);
ForAll(GetStockIDFilter_MTR As ThisNumber,
Collect(GetItemNumberTableDate_MTR, Filter(Purchase_ItemNumberTable, StockID = ThisNumber.Result))
)

 

 

View solution in original post

@Alex_10  & @StalinPonnusamy  thanks to your reply and spend your time.

I forget above logic. So, I made mistake. 

Anyway, Thanks @Alex_10 🤝

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,901)