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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
BenGi
Frequent Visitor

Filter a table using multiple values from an other table

Hello 

I have a table containing a lot of data. These data are catagorized by a RecordtypeID.

I want to filter this table on 2 RecordTypeID.

I would like to use the Recordtype table to filter the 2 RecordType like this

-------

let
Source = Salesforce.Data("https://login.salesforce.com/", [ApiVersion=48, CreateNavigationProperties=true]),
RecordType = Source{[Name="RecordType"]}[Data],
#"Autres colonnes supprimées" = Table.SelectColumns(RecordType,{"Id", "DeveloperName"}),
#"Lignes filtrées1" = Table.SelectRows(#"Autres colonnes supprimées", each ([DeveloperName] = "A" or [DeveloperName] = "B")),
Id = #"Lignes filtrées1"[Id]
in
Id 

-----

and then use this result to filter my fact table at the first step to avoid to load all the data from the source.

--------

let
Source = Salesforce.Data("https://login.salesforce.com/", [ApiVersion=48, CreateNavigationProperties=true]),
Case = Source{[Name="Case"]}[Data],
#"Lignes filtrées" = Table.SelectRows(Case, each([RecordTypeId]=??????????))
in
#"Lignes filtrées"

----------

I try using query parameters without success.

Any suggestion to do it ?

1 ACCEPTED SOLUTION
collinsg
Super User
Super User

Good day BenGi,

The List.Contains function may be used. Its first parameter is a list to search. Its second parameter is the value to search for.

If your first table is called “Table 1” then you can replace,

each( [RecordTypeId]=?????????? )

by

each List.Contains( #"Table1"[RecordTypeId], [RecordTypeId] )

#"Table 1"[RecordTypeId] is a list. It is the list of values in the "RecordTypeId" column of "Table 1" .

View solution in original post

1 REPLY 1
collinsg
Super User
Super User

Good day BenGi,

The List.Contains function may be used. Its first parameter is a list to search. Its second parameter is the value to search for.

If your first table is called “Table 1” then you can replace,

each( [RecordTypeId]=?????????? )

by

each List.Contains( #"Table1"[RecordTypeId], [RecordTypeId] )

#"Table 1"[RecordTypeId] is a list. It is the list of values in the "RecordTypeId" column of "Table 1" .

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors