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

Parameters and Templates in Power BI Desktop

Hi All,

 

Need some help with Parameters in Power BI Desktop. Parameters works perfectly for me with the server and database, but I need the schema as well, please help.

 

How do I do a parameter on the schema? It doesn't work when I put the parameter inside the schema.

 

let
Source = Sql.Database(Server, Database),
dbo__addresses = Source{[Schema="dbo",Item="parameterTest"]}[Data]

 

Server and Database working great. ParameterTest no good.

1 ACCEPTED SOLUTION

In your parameter you refer to query Accounts and in your previous post I see a query Accounts in which the parameter is used.

That is most probably causing the cyclic reference error.

 

The query referenced in your parameter should be a query that just creates a list of valid entries you can choose from, not the query in which the parameter is used.

Specializing in Power Query Formula Language (M)

View solution in original post

8 REPLIES 8
freder1ck
Kudo Kingpin
Kudo Kingpin

should parameterTest be in quotes?

Neither with or without quotes works.

My suggestion would be to share all relevant information required to help you.

 

Any screen shots of the relevant table entries at the source step, the value and definition of you parameter, anything else that might be relevant.

 

I will illustrate below.

 

In my opinion it should work without the quotes.

 

This works with me (but I don't have a sql database).

 

let
    Source = #table(type table[Schema = text, Item = text, Data = text],{{"dbo","Item1","Data1"},{"dbo","Item2","Data2"}}),
    dbo__addresses = Source{[Schema="dbo",Item=parameterTest]}[Data]
in
    dbo__addresses

 

Table at the Source step:

 

Source table.png

 

Query Item (for the list with valid parameter values):

 

let
    Source = #table(type table[Schema = text, Item = text],{{"dbo","Item1"},{"dbo","Item2"}}),
    Item1 = Source[Item]
in
    Item1

 

parameterTest:

 

parameterTest.png

Specializing in Power Query Formula Language (M)

1.png2.png3.png

lync0056, 

Ah, your parameter is named Username? That might be a reserved keyword. And, yes, parameters should not be in quotes. 

 

Fred

Tried ClientUsername and same error

 

Screen Shot 2018-01-03 at 11.23.35 pm.png

In your parameter you refer to query Accounts and in your previous post I see a query Accounts in which the parameter is used.

That is most probably causing the cyclic reference error.

 

The query referenced in your parameter should be a query that just creates a list of valid entries you can choose from, not the query in which the parameter is used.

Specializing in Power Query Formula Language (M)

All working now, thank you very much.

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.