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
Anonymous
Not applicable

Using a lookup in M in one query to set a parameter within another query

Ok.

 

I've discovered when using SharePoint lists as a data source that all reference is thorugh the GUID for the site and then the GUID for the lists.

 

This poses some fun when moving between a development source to a production source as I have to manually go in to the queries and change the GUIDs for each list.

 

As I can bring in the list of GUIDs for all lists I was wondering if there was an "easy" way of querying this list  and where it matches the name of the list I need it then uses the appropriate GUID within the M query for that list.

 

Any ideas?

 

Cheers,

Andrew.

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @Anonymous

 

You could possibly do this by having one table that has a list of the GUID's

 

And then you have another table for your data.

 

Then Merge the tables into a new table in the Query Editor, and you can then do an Inner Join and match them on the GUID.

This will ensure that it only brings down the data where the rows are matched?

 

You could create a Parameter for your Source, or GUID.

And then when you are building up your SharePoint Source List, you can then use the Parameter GUID as part of your source. So that going forward all that you would need to do is to change the GUID Parameter and then it should point at the new location?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

@GilbertQ Thanks. I had built the parameters out for the list GUIDs but there's a lot 🙂 So moving this through DEV, TEST and then PROD  environments means I will have to change the list parameters manually each time.

 

Just thought there may have been a way in M to automate this. Don't know of one myself but kind of wishful thinking someone may have some magic to do this.

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.