Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anushavikram
Frequent Visitor

Filter the contents of a table based on parameter of type Query in Power Query

Hi, 

 

Im new to power query. Im trying to filter a table based on a list of values passed as parameter. 

Something like this. 

pic1.JPG

dolphin_code is generated from another table by taking distinct values of a column. Something like below. 

 

let
Source = Sql.Database("HOTEDWSQL01", "EDW_Reporting"),
dbo_dim_outlet = Source{[Schema="dbo",Item="dim_outlet"]}[Data],
#"Filtered Rows" = Table.SelectRows(dbo_dim_outlet, each ([is_orbit] = "No") and ([dolphin_code] <> null)),
dolphin_code1 = #"Filtered Rows"[dolphin_code],
#"Removed Duplicates" = List.Distinct(dolphin_code1)
in
#"Removed Duplicates"

 

 

I applied rthis parameter as a filter on a column of a different table. 

The M code genrated was like this. 

Table.SelectRows(#"Filtered Rows2", each Text.Contains([store_id], BranchCode))

 

I modified this to 

= Table.SelectRows(#"Filtered Rows2", each List.Contains([store_id], BranchCode))

so as to filter by all the values in paramter and not just currennt value. 

 

This gives me an error as below. 

pic2.JPG

 

Kindly help. 

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @anushavikram ,

 

Please change the Suggested value to list of values to have a try. 

 

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @anushavikram ,

 

Please change the Suggested value to list of values to have a try. 

 

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.