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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
anktaggrwl
Kudo Collector
Kudo Collector

Filtering a table based on values within a nested table

I have an events object that I'm querying on salesforce that has the following format:

 

IdBusiness_Unit__cRecordType
ABC123XYZValue
ABC124SYWValue
ABC125SYWValue
ABC126XYZValue
ABC126XYZValue

 

I'd like to only bring back rows where EITHER [Business_Unit__c] = "XYZ" or the [Name] field within the record type value table = "XYZ".

 

The first filter of the 'either' statement is pretty straightforward:

 

= Table.SelectRows(Source{[Name="Event"]}[Data], each [Business_Unit__c]="XYZ")

But how would I pass an OR to be a lookup based on the name of the value in the RecordType Column, so that I bring back those lines where [Name] within "Value" is also XYZ (since there a number of lines where [Business_Unit__c]<>"XYZ" but the Name field within RecordType DOES equal "XYZ" that I'm currently missing)?

 

4 REPLIES 4
ReportRanger
Helper III
Helper III

Hi @anktaggrwl were you able to find a solution? As a workaround, maybe you can try to test your connection with a 3rd party connector, which pulls data directly from the SF objects API and also lets you pre-filter your data in the UI. I've tried windsor.ai, supermetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the Salesforce connector in the data sources list:

 

SALESFORCE-1.png

 

After that, just grant access to your Salesforce account using your credentials, then on preview and destination page you will see a preview of your Salesforce fields:

 

SALESFORCE-2.png

 

There just select the fields you need. It is also compatible with custom fields and custom objects, so you'll be able to export them through windsor.  Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url. 

 

SELECT_DESTINATION_NEW.png

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @anktaggrwl,

 

Perhaps you could first expand the RecordType field, then, apply filters to [Business_Unit_c] and [Name] with OR logic.

 

After expanding all necessary columns, you can filter rows from UI.

1.PNG2.PNG

 

Alternatively, you can directly input code like:

= Table.SelectRows(#"Changed Type", each [Category] = "A" or [Sales] = 52)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

While I know I could expand the field and then apply filters in the UI, I'm ideally looking to pass the filter in the initial call, as there are limitations in the number of rows I can pull back - so it would be more ideal to expand the RecordType field and filter for that AND filter in the business unit in one line... I'm just not sure how to write the expand and filter lines into one command.

Hi @anktaggrwl,

 

Please see whether below thread helpful to you:

Filtering a Power Query Table Based on a Column That's a Table

 

By the way, for more professional advice about Power Query, you could post questions on Power Query forum.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors