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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jirineoral
Post Patron
Post Patron

Server name parameterization causes refresh issues

Hi,
last Power BI desktop update introduced parameters. I changed hard coded Server name in pbix and replaced it with parameter SERVER_NAME. After this change refreshes through Enterprise Gateway took unusually long time and finally resulted in error for unknown reason. Took me 2 days to resolve this (did other changes as well)
Server name as a parameter is a must for moving from dev to production.  

Did anyone encounter the same issues? I already posted an idea to fix so please vote if you find this useful

https://ideas.powerbi.com/forums/360879-issues/suggestions/14151696-server-name-parameterization-cau...


Thanks

Jiri

5 REPLIES 5
dimazaid
Microsoft Employee
Microsoft Employee

hi @jirineoral,
Could you elaborate more about the problem/suggestion? Was it a Gateway issue that was causing this refresh to fail?

Hi @dimazaid,

I'm importing data from SSAS Multidimensional. In my .pbix file I had server name as constant for all my MDX queries. Refresh worked ok. After introduction of parameters. I replaced server name with parameter passing the same value of registered data source in Power BI Enterprise Gateway. Refreshes started to fail. Because I did multiple steps lately (updated Gateway as well) I didn't know what the problem is.

Yesterday I simulated same steps on demo data before changing server name to parameter value. Refresh works, after change fails witch unknown error in EG.

So I suspect that this is problem of EG that it somehow can't read properly parameter value? Not sure.

 

Jiri

@jirineoral - While I realize it is a workaround, it would be interesting if you tested the techique I posted to see if the EG's problem with parameters is a general problem or if it is specific to the use of the parameter as the server name/connection string. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

As a work-a-round, you might try something like this:

 

let
    DevSource = Csv.Document(File.Contents("C:\temp\powerbi\test_dev.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    ProdSource = Csv.Document(File.Contents("C:\temp\powerbi\test_prod.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    
    #"Promoted Headers Dev" = Table.PromoteHeaders(DevSource),
    #"DevResult" = Table.TransformColumnTypes(#"Promoted Headers Dev",{{"Column1", type text}, {"Column2", Int64.Type}}),

    #"Promoted Headers Prod" = Table.PromoteHeaders(ProdSource),
    #"ProdResult" = Table.TransformColumnTypes(#"Promoted Headers Prod",{{"Column1", type text}, {"Column2", Int64.Type}}),

    result = 
        if Environment = "Dev"
        then #"DevResult"
        else #"ProdResult"
in
    #"result"

This uses a parameter called "Environment" that can either be "Dev" or "Prod"



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler,

but I don't need workarounds. I already contacted support with this problem, I was just curious, if anyone has the same problem as I do. Your solution requires rewriting M code and if I need to to this, I can rewrite the server name directly.

 

Jiri

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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