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

Parameters arent detected in Power BI Services

Hi

 

I need to use parameters in my queries, I have 2: One to choose between "TEST" and "PROD" and one to select a number.

Both parameters are type text, and are a list of values, and required. I have also tried with type decimal and any value for the number parameter, but no matter what I do the Power Bi Services doesn't see the parametes.

It says

Parameters haven't been defined for this dataset yet. If you want to set parameters, use the Query Editor.

I know for certain I am looking at the correct dataset, and I have tried deleting the dataset and reuploading to make sure it's a "fresh" upload. I have also tried uploading it to other workspaces but none see the parameters. Parameters are enabled load.

 

Why does Services not see my parameters?Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Final solution : 

When your parameters are not detected , then recreate your powerbi desktop file by exporting / importing a template file

  • menu File/Export/Template=>generate a .pbit file
  • load the pbit file, and after the refresh, save the result as a new pbix file.

By the way, note that IT IS possible to have the datasource as a parameter.

You should only take care to use the parameter "as is", without any calculation.

  • SharePoimt.Files(MyParameterURL) works fine
  • SharePoint.Files(Text.Left(MyParameter, 10)) doesn't work because the powerBI service is not able to find the datasource and check the permissions....

 

Hope it helps,

Gregoire

View solution in original post

13 REPLIES 13
hugomuacho
New Member

Hy,

I have the same problem, the parameters are not recognized in Powe BI Services.

The parameters are enabled for loading and I tried to recreate the file with an export / import to a PBIT model and load this pbi into the workspaces, but we still don't see the parameters. 

 
 
 
Anonymous
Not applicable

Hi,

 

Have you created and selected a gateway for the dataset? I think it might have been related to that in my case.

Anonymous
Not applicable

What are these parameters for ?  how are they used in our source code ? Is it linked to the url of the data source ?

Please send the code (Query-M) of the parameter + the code which is using this parameter.

Anonymous
Not applicable

Hi there, Same issue here and let me paste the M query here:


Query:
let
Source = Sql.Database("xyz.database.windows.net", "database"),
#"Filtered Rows" = Table.SelectRows(Source, each [Item] = #"Data Table"),
table = #"Filtered Rows"{[Schema="countryschema",Item=#"Data Table"]}[Data]
in
table

Parameter:
"abc" meta [IsParameterQuery=true, List={"abc", "def"}, DefaultValue=..., Type="Any", IsParameterQueryRequired=true]

I use Azure SQL DW connector direct query mode if that helps.

Ray

simen-aakhus
Frequent Visitor

Hi @Anonymous,

 

I am experiencing the same issue - Power BI service not detecting my parameters from the PBIX. I have only 1 parameter of type text which is Environment (values Dev, Test, Prod). 

 

I tried exporting as template, and importing again, and I have tried both Publish and using SharePoint online for sync. 

 

How did it resolve for you?

 

Best Regards,

Simen

Anonymous
Not applicable

You can not have a datasource string (eg Sharepoint URL) which depends on an other parameter.

The Sharepoint url must be either hard-coded in your source code, either in a parameter.

 

Why ? As soon as you perform any calculation on the string, Power BI service can not know anymore which is the data source.

And power BI requires to know the datasource, for many reasons.

 

=> Replace your parameter DEV/TEST/PROD by one parameter SharepointURL and it will solve your issue.

Then, if it doesn't work immediately, try to recreate the file with an export/import to a PBIT template.

 

Best regards,

Grégoire

v-cherch-msft
Employee
Employee

Hi @Anonymous 

 

You may find it in Settings->Datasets.For further,you may have a look at this article.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherie

 

I have read the article and microsofts own article about parameters. However, that's exactly the problem. Neither of my parameters are visible in settings > datasets.

https://docs.microsoft.com/en-us/power-bi/service-parameters

 

I do look at the correct dataset, and I know it's the updated version of the dataset. Parameters aren't showing in Power BI Services

Hi @Anonymous 

 

Please make sure you've used the parameter for your table in desktop.Then it will be visible in settings > datasets.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherie

 

I use both parameters directly to get the source data, they are used to modify a URL link and a Sharepoint folder.

 

Could this issue be related to Sharepoint not allowing a scheduled refresh? 

 

Capture.PNG

Hi @Anonymous 

 

It cannot be refreshed when the data source is a parameter of the function.For further,please vote for this idea.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Final solution : 

When your parameters are not detected , then recreate your powerbi desktop file by exporting / importing a template file

  • menu File/Export/Template=>generate a .pbit file
  • load the pbit file, and after the refresh, save the result as a new pbix file.

By the way, note that IT IS possible to have the datasource as a parameter.

You should only take care to use the parameter "as is", without any calculation.

  • SharePoimt.Files(MyParameterURL) works fine
  • SharePoint.Files(Text.Left(MyParameter, 10)) doesn't work because the powerBI service is not able to find the datasource and check the permissions....

 

Hope it helps,

Gregoire

I tried exporting and importing with pbit...what exactly is that supposed to do for you?  When I open it it asks for parm values and then opens.  I tried re-publishing to workspace and no change.  Not sure why that would impact parms showing in dataset anyways. I've got this to work for single query in dataset before but when I attempt with multiple tables it doesn't work.  Curious if all tables have to have parameters applied to filter as I'm only doing some of them.

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.

Top Solution Authors
Top Kudoed Authors