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
Styles1980
Regular Visitor

Matching data between queries without merging in MQuery

Hi Everyone,

I am looking for some help with a current issues, Thank you in advance for any help you can provide.

I have 2 data queries pulling from different spreadsheets/api - I need to pull through the names of all individuals in query A that match criteria between the 2 queries, for example

Pulls through Bob if date from query 1 is >= effective start date in query 2 and role from query 1 = role from query 2.

If i merge queries I only get 1 match per row and need to pull through all possible matches.
If i pull Query 1 into Query 2 without merging I end up with 85 million rows which isnt feasible from a load perspective.

I have tried but get error that 3 arguements were passed when 2 expected.

= Table.SelectRows(#"Replaced Value1", "Custom", each ((Schedule[Date] >= [Effective Start] and Schedule[Level] = [Level] and Schedule[Capability] = [Spec] and Schedule[Role] = [Role] and Schedule[Availability] = "Available")))

Also tried the below in a custom column but everything pulls through as null

let valdate = [Effective Start],

valdate1 = Schedule[Date],

vallevel = [ResourceLevelSortOrder],

vallevel1 = Schedule[LevelSortOrder],

valspec = [Spec],

valspec1 = Schedule[Capability],

valrole = [Role],

valrole1 = Schedule[Role],

valname = Schedule[Name],

valavail = Schedule[Available],

userlist = Table.SelectRows(Schedule, each valdate1 >= valdate and vallevel1 = vallevel and valspec1 = valspec and valrole1 = valrole and valavail = "Available")

in 

userlist


Also tried this in a custom column but it would come through as a function rather then list

let

valdate = [Effective Start],

valdate1 = Schedule[Date],

vallevel = [ResourceLevelSortOrder],

vallevel1 = Schedule[LevelSortOrder],

valspec = [Spec],

valspec1 = Schedule[Capability],

valrole = [Role],

valrole1 = Schedule[Role],

valname = Schedule[Name],

valavail = Schedule[Available]

in 

each List.Select(valname,each (valdate1 >= valdate) and (vallevel1 = vallevel) and (valspec1 = valspec) and (valrole1 = valrole) and (valavail = "Available")))


Pictures of 2 queries
Query 1 list of names to show if other columns match query 2

 

Styles1980_0-1674154106824.png


Query 2 which i want the list to pull into after matching criteria between both queries

Styles1980_1-1674154176743.png

 

Recap - I need a list of names to populate from Query 1 when columns in both Query 1 & 2 match. 



3 REPLIES 3
Styles1980
Regular Visitor

Hi @Mahesh0016 
Did you have a chance to review the above and any possible solutions to obtain the list of relevant matches
Thanks

 

Mahesh0016
Super User
Super User

@Styles1980 Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Hi @Mahesh0016 
Query 1 would look like this - a line per person for each day of the year except weekends.

NameDateRoleLevelCapabilityLevelSortOrderAvailability
Ntba A01/02/23EngineerMidFrontend (React)3Available
Ntba B01/02/23EngineerMidFrontend (React) 3Available
Ntba C01/02/23EngineerMid

Frontend (React)

 

3Assigned

Query 2 This has the requirements of what we need to match against Query 1

Outcome would be each persons name next to the match, creating a new row for each entry. So for Project A we would have no matches, Project B we would have 2 rows with the names Ntba A and Ntba B, Project C no matches.

ProjectEffective StartRoleLevelSpecResourceLevelSortOrder
A01/01/23EngineerSeniorFrontend (React)4
B21/03/23EngineerMidFrontend (React)3
C01/04/23Engineering Managern/an/a6

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
Top Kudoed Authors