Forum Discussion
jirineoral
10 years agoPost 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 to...
Greg_Deckler
10 years agoCommunity Champion
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"
jirineoral
10 years agoPost Patron
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