Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I'm very new to PowerBI, so forgive me if this is a simple question. Exactly how does self reference in R effect the results of a Power BI query? If I were to run a very simple script, say
set.seed(50)
x = rnorm(n = 100, mean = 0, sd = 1)
x = as.data.frame(x)
I get a table, named "X", with a single column, named "get(x)", and a single row, "x"
But when I run a slightly more complicated script
set.seed(50)
x = rnorm(n = 100, mean = 0, sd = 1)
y = as.data.frame(x)
I get a table, named "y", with a single column, named "x", and 100 rows from a normal distribution.
In R, the results are the same, except for the name of the variable. Both scripts result in a data.frame with one column and 100 rows. In PowerBI, I have no idea what's going on. Is it getting stuck on have a data.frame with the exact same name as what it wants to use as the column name?
Solved! Go to Solution.
I have tested this R script in R Studio and Power BI desktop. I get the same result as yours. The issue could be caused the get data mechanism in Power BI. The acceptable thing is that you can use your second script to get your expected dataset currently. I will report this issue internally.
set.seed(50)
x = rnorm(n = 100, mean = 0, sd = 1)
y = as.data.frame(x)
Regards,
Charlie Liao
I have tested this R script in R Studio and Power BI desktop. I get the same result as yours. The issue could be caused the get data mechanism in Power BI. The acceptable thing is that you can use your second script to get your expected dataset currently. I will report this issue internally.
set.seed(50)
x = rnorm(n = 100, mean = 0, sd = 1)
y = as.data.frame(x)
Regards,
Charlie Liao
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |