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
gil12
Helper I
Helper I

Passing parameters as a data source path to other table

Hello,

I have parameters table, it basically had index (integar column) and path (data source path). Now I'd like to pass a value from a path column to any particular table based on index column. My sources path, file names etc changes quite often and multiple dashboard consumes these sources. So i'd like to manage this parameters table to update paths. 

Has anyone done something like that? Previously i had function created where you can pass table name and index and it'll pick up a source path but when uploading dashboard to services, got a error since it have to have a direct connection to sources.

 

Does anyone have a better solution? if not could anyone help me with above question?

 

@Greg_Deckler 

 

Thanks in advance

 

help.PNG

 

Let

Source = Excel.Workbook(File.Contents("path from above table based on provided Index"), null, true),

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

Hi, @gil12 

 

Based on your description, I'd like to suggest you use ‘Manage Parameters’ in Query Editor to parameterise a Data Source. 

 

You may create a parameter with a list of data source path names and a parameter with a list of table names as below.

d1.png

d2.png

 

Then you need to create a new query with the following code in 'Advanced Editor'.

d3.png

 

When p1 = '...\Client A-Sequence number' and p2 = 'ClientA', here is the result.

d4.png

 

When p1 = '...\Client B-Sequence number' and p2 = 'ClientB', here is the result.

d5.png

 

For further information, please refer the article .

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-alq-msft
Community Support
Community Support

Hi, @gil12 

 

Based on your description, I'd like to suggest you use ‘Manage Parameters’ in Query Editor to parameterise a Data Source. 

 

You may create a parameter with a list of data source path names and a parameter with a list of table names as below.

d1.png

d2.png

 

Then you need to create a new query with the following code in 'Advanced Editor'.

d3.png

 

When p1 = '...\Client A-Sequence number' and p2 = 'ClientA', here is the result.

d4.png

 

When p1 = '...\Client B-Sequence number' and p2 = 'ClientB', here is the result.

d5.png

 

For further information, please refer the article .

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! I think this will work for me.

parry2k
Super User
Super User

@gil12 you can do something like this before source

 

let
 myIndex = 1,  
 myPath = Table.SelectRows(#"Your path table name", each [Index]=myIndex){0}[path],

 

and you can use myPath in source 

 

I would 💖 Kudos 🙂 if my solution helped. If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi there, 

Get following error when passing your suggested parameters. Also when uploading it to services and setting up Gateway, i'm expecting an error saying "Power bi requires absolute path to the data sources". Can you please help?

If you have any solution for my problem, i'd appreciate that as well! Basically my sources changes often and I'd like one table where i upload path and all dashboard get updated with new paths.

 

Error snip below:

Capture.PNG

@gil12 this is a different issue, check details at this link.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Do you suggest that I’d do something differently for access source path for my tables from one table?

@gil12 no it is a data privacy issue, did you read the post I mentioned earlier.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.