我可以 运行 我自己的针对 Power BI 的 DAX 或 MDX 查询吗?
Can I run my own DAX or MDX queries against Power BI?
我在 Power BI 桌面中有一个数据模型。我想将它发布到服务器,但我也想有一个针对它的内部报告 运行 MDX(或 DAX)查询。这可能吗?我可以只创建一个连接字符串并像连接 SSAS 多维数据集一样连接到 Power BI 吗?也许使用 REST API?
编辑:
感谢您的回答。 Kyle 为我的问题提供了最佳答案,所以我接受了他的答案,但你们所有人都让我明白,我最好只使用 SSAS。这就是我所做的,在查看 HTTP 桥时遇到了一些麻烦,但它现在就像一个魅力。
据我所知这是不可能的。不知道有没有办法解决。
使用 SSAS 并连接到一个模型可能会更好,因为无论是从 Power BI 使用 AS Connector 还是对于您需要 运行 反对它的任何 DAX 查询。
通过发布,如果您打算将其发布到 SharePoint 上,那么,是 there is a way to access it.
PowerPivot for SharePoint actually consists of two components. First, there is the Service Application that runs in the SharePoint farm that is responsible for performing data refreshes, and usage analytics. The main part however is actually an instance of Analysis Services using the tabular engine. It’s properly referred to as Analysis Services SharePoint Mode, and as of SharePoint 2013/SQL Server 2012 SP1, it can be installed standalone. However, it is most commonly installed on SharePoint front end servers.
In the case above, the SharePoint front end server is named NautilusSP. You can also see that there is a model being hosted by the server already. The model is named by taking a workbook, and adding a GUID to it. This is done by Excel Services the first time that a model is interacted with. For example, if we add the file Health.xlsx, which contains an embedded PowerPivot model, and immediately refresh the object explorer in Management Studio, we will see that nothing has changed. However, if we then interact with the model at all, by clicking a slicer, or opening a pivot table category, we will see that the model has been automatically created for us.
注意事项:
These models are temporary. If they haven’t been used for a period of
time, they get deleted. Also, if the source workbook is updated, a new
model is automatically create upon first interaction. This can be seen
if we edit, and save our Health.xlsx workbook, and then open it in the
browser and interact with it.
The original model will be deleted in a garbage collection process. We
therefore cannot reliably target these models, as any reference will
become invalid relatively quickly.
更好且实际可扩展的选项是创建一个表格模型(我们在这里谈论 SSAS)并将此 PowerPivot 模型导入其中。
从字面上看,这实际上是可能的 - 每次您 运行 PowerBI 时,它都会创建一个 behind-the-scenes SSAS 表格实例,您可以连接到该实例并对其进行 运行 查询。显然,这不受 Microsoft 的直接支持,但我保留了这些步骤,以防其他人想知道如何操作:
- 导航到
%user%/AppData/Local/Temp/Power BI Desktop
- 打开您的 PowerBI Desktop 模型
- 临时文件夹中会出现一个新文件夹,里面是一个名为AnalysisServicesWorkspace1111111111的文件夹(末尾数字随机)
- 该文件夹内有一个文件 msmdsrv.port.txt,其中包含端口号 (portnum),SSAS 表格模型 运行ning[=] =28=]
- 您可以打开 SSMS 并连接到 Analysis Services 服务器 localhost:portnum
- 您可以通过 SSMS 或工作区文件夹中 GUID 文件夹的名称找到特定的数据库实例(类似于“33df46dd-8c77-46eb-bf01-8d545f626723. 0.db")
- 或者您可以将其用作 SSAS 连接字符串中的服务器/目录,即
Provider=MSOLAP.5;Integrated Security=SSPI;Persist Security Info=True;
Initial Catalog=databasename;Data Source=localhost:portnum;
MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error
此外,对于值得注意的开发人员,*.db 文件夹中是一个包含所有 PowerBI 模型元数据的 SQLite 数据库,您可以通过代码修改它,只要您在 UI 例如 select 添加计算列然后单击离开。
我在 Power BI 桌面中有一个数据模型。我想将它发布到服务器,但我也想有一个针对它的内部报告 运行 MDX(或 DAX)查询。这可能吗?我可以只创建一个连接字符串并像连接 SSAS 多维数据集一样连接到 Power BI 吗?也许使用 REST API?
编辑: 感谢您的回答。 Kyle 为我的问题提供了最佳答案,所以我接受了他的答案,但你们所有人都让我明白,我最好只使用 SSAS。这就是我所做的,在查看 HTTP 桥时遇到了一些麻烦,但它现在就像一个魅力。
据我所知这是不可能的。不知道有没有办法解决。
使用 SSAS 并连接到一个模型可能会更好,因为无论是从 Power BI 使用 AS Connector 还是对于您需要 运行 反对它的任何 DAX 查询。
通过发布,如果您打算将其发布到 SharePoint 上,那么,是 there is a way to access it.
PowerPivot for SharePoint actually consists of two components. First, there is the Service Application that runs in the SharePoint farm that is responsible for performing data refreshes, and usage analytics. The main part however is actually an instance of Analysis Services using the tabular engine. It’s properly referred to as Analysis Services SharePoint Mode, and as of SharePoint 2013/SQL Server 2012 SP1, it can be installed standalone. However, it is most commonly installed on SharePoint front end servers.
In the case above, the SharePoint front end server is named NautilusSP. You can also see that there is a model being hosted by the server already. The model is named by taking a workbook, and adding a GUID to it. This is done by Excel Services the first time that a model is interacted with. For example, if we add the file Health.xlsx, which contains an embedded PowerPivot model, and immediately refresh the object explorer in Management Studio, we will see that nothing has changed. However, if we then interact with the model at all, by clicking a slicer, or opening a pivot table category, we will see that the model has been automatically created for us.
注意事项:
These models are temporary. If they haven’t been used for a period of time, they get deleted. Also, if the source workbook is updated, a new model is automatically create upon first interaction. This can be seen if we edit, and save our Health.xlsx workbook, and then open it in the browser and interact with it.
The original model will be deleted in a garbage collection process. We therefore cannot reliably target these models, as any reference will become invalid relatively quickly.
更好且实际可扩展的选项是创建一个表格模型(我们在这里谈论 SSAS)并将此 PowerPivot 模型导入其中。
从字面上看,这实际上是可能的 - 每次您 运行 PowerBI 时,它都会创建一个 behind-the-scenes SSAS 表格实例,您可以连接到该实例并对其进行 运行 查询。显然,这不受 Microsoft 的直接支持,但我保留了这些步骤,以防其他人想知道如何操作:
- 导航到
%user%/AppData/Local/Temp/Power BI Desktop
- 打开您的 PowerBI Desktop 模型
- 临时文件夹中会出现一个新文件夹,里面是一个名为AnalysisServicesWorkspace1111111111的文件夹(末尾数字随机)
- 该文件夹内有一个文件 msmdsrv.port.txt,其中包含端口号 (portnum),SSAS 表格模型 运行ning[=] =28=]
- 您可以打开 SSMS 并连接到 Analysis Services 服务器 localhost:portnum
- 您可以通过 SSMS 或工作区文件夹中 GUID 文件夹的名称找到特定的数据库实例(类似于“33df46dd-8c77-46eb-bf01-8d545f626723. 0.db")
- 或者您可以将其用作 SSAS 连接字符串中的服务器/目录,即
Provider=MSOLAP.5;Integrated Security=SSPI;Persist Security Info=True;
Initial Catalog=databasename;Data Source=localhost:portnum;
MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error
此外,对于值得注意的开发人员,*.db 文件夹中是一个包含所有 PowerBI 模型元数据的 SQLite 数据库,您可以通过代码修改它,只要您在 UI 例如 select 添加计算列然后单击离开。