我可以将具有 1 个值的 table 转换为 Power BI 中的文本格式吗?

Can I transform a table with 1 value into a text format in power BI?

我在 Power BI 中使用 R.execute 查找计算机当前用户的用户名。 (我们的组织与 Sharepoint 合作)。这样我想为任何用户创建一个普遍真实的文件路径。此 M 代码位于独立的 table 中。我想将此 table 形成文本格式而不是 table 以便我可以将其用作文件路径的文本变量。

用于查找用户名的 M 代码:

let
        RScript = R.Execute("output <- read.table(text=system2(""whoami"", stdout=TRUE))"),
        output = RScript{[Name="output"]}[Value]
in
        output

现在,这将创建一个只有 1 个值的 table。有什么办法可以将其转换为简单的文本值吗?或者也许 select 这个单一值作为我的文件路径的变量执行?

感谢您的帮助!

只需指定行号和列名:

output = RScript{[Name="output"]}[Value]{0}[Column1]

或者,假设可以更改列名:

output = Record.FieldValues(RScript{[Name="output"]}[Value]{0}){0}