PowerBI 中的交互式对话框
Interactive Dialog Box in PowerBI
有没有办法在 PowerBI 中创建交互式对话框?
我在查询编辑器中嵌入了 R 脚本,我希望在我可以使用的地方有一个交互方面:
file<-winDialogString("File input?","")
此输入将用作读取 csv 的文件位置,每次有人打开并执行 PowerBI 文件的主副本时,他们都可以输入新的文件位置。
我也愿意接受 html、javascript、python...任何可以提供帮助的东西。
实现您在 Power BI 中提到的内容的最佳方法是利用 parameters
并参数化您的查询以获取 csv 文件。
假设我们有一个名为 SalesJan2009.csv
的 csv 文件。当您将它导入 Power BI 时,您应该有类似的内容:
let
Source = Csv.Document(File.Contents("\Mac\Home\Downloads\SalesJan2009.csv"),[Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Transaction_date", type datetime}, {"Product", type text}, {"Price", Int64.Type}, {"Payment_Type", type text}, {"Name", type text}, {"City", type text}, {"State", type text}, {"Country", type text}, {"Account_Created", type datetime}, {"Last_Login", type datetime}, {"Latitude", type number}, {"Longitude", type number}})
in
#"Changed Type"
如果我们希望用户输入文件位置(即\Mac\Home\Downloads\
),我们可以在Power BI中设置一个参数:
然后我们可以更新查询以使用参数:(查询 -> 高级编辑器)
let
Source = Csv.Document(File.Contents(#"FileLocation" & "SalesJan2009.csv"), ...
...
如果用户以后想更改参数(文件位置),他们可以编辑参数并应用更改以刷新数据。
P.S。您甚至可以进一步 export the Power BI file as a template 以允许用户将其实例化为新的 Power BI Desktop 报表(PBIX 文件)。
有没有办法在 PowerBI 中创建交互式对话框?
我在查询编辑器中嵌入了 R 脚本,我希望在我可以使用的地方有一个交互方面:
file<-winDialogString("File input?","")
此输入将用作读取 csv 的文件位置,每次有人打开并执行 PowerBI 文件的主副本时,他们都可以输入新的文件位置。
我也愿意接受 html、javascript、python...任何可以提供帮助的东西。
实现您在 Power BI 中提到的内容的最佳方法是利用 parameters
并参数化您的查询以获取 csv 文件。
假设我们有一个名为 SalesJan2009.csv
的 csv 文件。当您将它导入 Power BI 时,您应该有类似的内容:
let
Source = Csv.Document(File.Contents("\Mac\Home\Downloads\SalesJan2009.csv"),[Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Transaction_date", type datetime}, {"Product", type text}, {"Price", Int64.Type}, {"Payment_Type", type text}, {"Name", type text}, {"City", type text}, {"State", type text}, {"Country", type text}, {"Account_Created", type datetime}, {"Last_Login", type datetime}, {"Latitude", type number}, {"Longitude", type number}})
in
#"Changed Type"
如果我们希望用户输入文件位置(即\Mac\Home\Downloads\
),我们可以在Power BI中设置一个参数:
然后我们可以更新查询以使用参数:(查询 -> 高级编辑器)
let
Source = Csv.Document(File.Contents(#"FileLocation" & "SalesJan2009.csv"), ...
...
如果用户以后想更改参数(文件位置),他们可以编辑参数并应用更改以刷新数据。
P.S。您甚至可以进一步 export the Power BI file as a template 以允许用户将其实例化为新的 Power BI Desktop 报表(PBIX 文件)。