The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Can someone explain why this R script is not allowed to return environment information in Power BI?
If I run it in RGui then I receive the Windows username as expected
let source = R.Execute("Sys.getenv(""USERNAME"")") in source
Solved! Go to Solution.
Hi @Brian_M,
I can reproduce your issue, even if I test "OS", "Path" but I still get the empty result. I also try to use "get data" from R script and get the same result.
Can you directly use R script to get the environment variables? If you can, it may means power bi not allow use R script to get environment information.
In addition, you can take a look at below article about using R script:
Running R Scripts in Power BI Desktop
Regards,
Xiaoxin Sheng
Hi @Brian_M,
I can reproduce your issue, even if I test "OS", "Path" but I still get the empty result. I also try to use "get data" from R script and get the same result.
Can you directly use R script to get the environment variables? If you can, it may means power bi not allow use R script to get environment information.
In addition, you can take a look at below article about using R script:
Running R Scripts in Power BI Desktop
Regards,
Xiaoxin Sheng
Thanks for the link. Yes, it works when used directly in R so it appears that Power BI is sandboxed in some way that it can't read that type of information.
User | Count |
---|---|
87 | |
84 | |
36 | |
35 | |
32 |
User | Count |
---|---|
96 | |
75 | |
67 | |
52 | |
52 |