Forum

Dynamic filter usin...
 
Notifications
Clear all

Dynamic filter using range of values entered in either of the Fields- PQ

3 Posts
2 Users
0 Reactions
164 Views
(@kopen)
Posts: 2
New Member
Topic starter
 

Hi,

In the attached sample file, I have two fields under the User Input tab; ID and SBU_Code. The user will enter a range of values under either of two fields(not both). Upon refreshing, it should dynamically filter the data in query1 and query2 to match the entered ID or SBU_Code.

Currently, I have used List.Contains() to filter just one field list(ID) at a time. I need to add SBU_Code using OR condition or something so that it satisfies the above requirement.

 
Posted : 18/07/2021 2:00 am
Anders Sehlstedt
(@sehlsan)
Posts: 970
Prominent Member
 

Hello,

Not sure if I understand your issue properly, but as has been done with the Parameter table for the ID you need to do the same for the SBU_CODE. Make it a table, load it to Power Query, make it a list and then you just put in an OR statement in your M code. In below example I have named your second list as Parameter_2.

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each List.Contains(Parameter,[ID]) or List.Contains(Parameter_2,[SBU_CODE])=true)

Br,
Anders

 
Posted : 18/07/2021 4:51 pm
(@kopen)
Posts: 2
New Member
Topic starter
 

Got it!

Thank you!

 
Posted : 19/07/2021 9:50 am
Share: