本文介绍了更新由R脚本生成的Power BI数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些桌子,例如tbl_A,tbl_B&在Power BI中使用R脚本创建的tbl_C。

I have some tables, e.g. tbl_A, tbl_B & tbl_C that are created in Power BI using R script.

R脚本是这样的:

df2 <- read.csv("data/customer.csv",quote="")
df2 <- read.csv("data/order.csv",quote="")

#performing various joins / aggregating data

tbl_A <- ...
tbl_B <- ...
tbl_C <- ...

然后我选择加载tbl_A,tbl_B和

And I choose to load tbl_A, tbl_B & tbl_C when the R script finish executing.

然后使用PowerBI可视化工具(如堆积的条形图)将这些表可视化。
此时一切正常。

Then those tables are visualized with PowerBI visualization tools such as stacked bar charts.Everything works fine at this point.

我的问题是我需要更新数据(因为每天都有新数据),而不必每一个是时候重新创建图表了。
我尝试重新运行R脚本并加载tbl_A,tbl_B和& tbl_C,但这会创建新的powerBI表(tbl_A(2),tbl_B(2)...),因此不会更新图表中使用的数据。

The issue I have is that I would need to update the data (because there is new data everyday) without having each time to recreate the charts.I tried re-running the R script and loading tbl_A, tbl_B & tbl_C, but this creates new powerBI tables (tbl_A (2), tbl_B (2) ...) and thus is not updating the data that is used in the charts.

是否有任何方法可以更新PowerBI可视化中使用的R脚本生成的数据?

Is there any way to update the data generated by R scripts used in PowerBI visualizations ?

推荐答案

遗憾的是,从目前开始这不可能PowerBI中R集成的当前水平。

Sadly this is not possible as of the current level of R integration in PowerBI.

PowerBI R可视化集成是通过将可视图像作为静态图像导入PowerBI来执行的。 Microsoft文档由于以下限制:

PowerBI R visualization integration is performed by importing the visual into PowerBI as a static Image. This is explained in the microsoft documentation due to the below limitation:

基本上,PowerBI不包含R图形设备直接进入GUI /可视界面,而是导入图像。我相信这可能是由于R的集成方式所致。每个R脚本似乎都是作为一个独立的R会话执行的,一旦脚本完成,它将关闭。因此,所有剩余的图形和数据都将被终止,并且必须重新运行脚本才能再次访问数据。

Basically, PowerBI doesn't incorporate the R graphics device directly into the GUI / visual interface, but rather imports the image. I believe this might be due to how R is integrated. Every R scripts seems to be executed as a self-contained R-session, which closes once the script has finished. Any leftover graphics and data will thus be terminated, and one would have to rerun the script to gain access to the data again.

这篇关于更新由R脚本生成的Power BI数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!