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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
biguy34965
Frequent Visitor

Dataflow parameter code addition to the source line

I have a dataflow that uses Starburst ODBC.  The parameter was created using a list. The list includes 2 different data sources. Having trouble changing the source line in Advanced Editor to accomodate the parameter instead of the hard coded data source. 
Here is an example of the current:

let
  Source = StarburstPresto.Contents("app-neu.starburst-sit.azpriv-cloud.xxxxxx.net", 443, null),
  #"Navigation 1" = Source{[Name = "thedatabasename", Kind = "Database"]}[Data],
  #"Navigation 2" = #"Navigation 1"{[Name = "the schemaname", Kind = "Schema"]}[Data],
  #"Navigation 3" = #"Navigation 2"{[Name = "thetablename", Kind = "Table"]}[Data]
in
  #"Navigation 3"
From searching the interwebs it appears the first line should be changed to contain the name of the parameter, which is "Starburst Data Source", but I cannot get it to work. 
1 ACCEPTED SOLUTION
v-kpoloju-msft
Community Support
Community Support

Hi @biguy34965,
Thank you for reaching out to the Microsoft fabric community forum.

I understand you are trying to make your dataflow more dynamic by using a parameter instead of hardcoding the Starburst data source in the Advanced Editor. You are on the right track just a small step is needed to get it working.

The StarburstPresto.Contents() function expects a single text value (like a server name), but your parameter "Starburst Data Source" is a list. So, before using it in the function, you need to pick one item from that list.

Update your M code like this:

let

  SelectedSource = #"Starburst Data Source"{0},

  Source = StarburstPresto.Contents(SelectedSource, 443, null),

  #"Navigation 1" = Source{[Name = "thedatabasename", Kind = "Database"]}[Data],

  #"Navigation 2" = #"Navigation 1"{[Name = "the schemaname", Kind = "Schema"]}[Data],

  #"Navigation 3" = #"Navigation 2"{[Name = "thetablename", Kind = "Table"]}[Data]

in

  #"Navigation 3"

You can change (0) to (1) if you want to use the second data source in the list.

Make sure your parameter is defined as a list of text values. If you want users to choose the source dynamically (like from a dropdown), consider using a text parameter instead of a list, or create a helper query to select the item.

Also, please refer to the below mentioned documentation link for more information:
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Parameters - Power Query | Microsoft Learn

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Fabric Community Forum.

View solution in original post

2 REPLIES 2
v-kpoloju-msft
Community Support
Community Support

Hi @biguy34965,
Thank you for reaching out to the Microsoft fabric community forum.

I understand you are trying to make your dataflow more dynamic by using a parameter instead of hardcoding the Starburst data source in the Advanced Editor. You are on the right track just a small step is needed to get it working.

The StarburstPresto.Contents() function expects a single text value (like a server name), but your parameter "Starburst Data Source" is a list. So, before using it in the function, you need to pick one item from that list.

Update your M code like this:

let

  SelectedSource = #"Starburst Data Source"{0},

  Source = StarburstPresto.Contents(SelectedSource, 443, null),

  #"Navigation 1" = Source{[Name = "thedatabasename", Kind = "Database"]}[Data],

  #"Navigation 2" = #"Navigation 1"{[Name = "the schemaname", Kind = "Schema"]}[Data],

  #"Navigation 3" = #"Navigation 2"{[Name = "thetablename", Kind = "Table"]}[Data]

in

  #"Navigation 3"

You can change (0) to (1) if you want to use the second data source in the list.

Make sure your parameter is defined as a list of text values. If you want users to choose the source dynamically (like from a dropdown), consider using a text parameter instead of a list, or create a helper query to select the item.

Also, please refer to the below mentioned documentation link for more information:
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Parameters - Power Query | Microsoft Learn

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Fabric Community Forum.

Thanks very much! Very helpful.  In the documentation, it seems to favor reports (report screens) to show functionality - rather than dataflows. It could just be me. 🙂 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors