如何在Microsoft PowerBI中使用SQL Server存储过程? [英] How to use SQL Server stored procedures in Microsoft PowerBI?

查看:744
本文介绍了如何在Microsoft PowerBI中使用SQL Server存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的SQL Server表中生成报告。

I want to generate reports from my SQL Server tables.

我已经有了一些存储过程,可以用来生成报告。

I have some already made stored procedures that I would like to use to generate reports from.

只能通过重写查询来实现。

Only by rewriting the queries.

谢谢:)

推荐答案

在Power BI中执行您的SP->

To execute your SP in Power BI-->

1。在SQL Server中,右键单击您的SP,然后选择执行。您的代码将被执行,并打开一个负责执行的新查询窗口。复制该查询。

1.In SQL Server right click on your SP and select Execute. Your code is executed and a new query window opens up which was responsible for execution. Copy that Query.

2。在Power BI查询编辑器中,选择新建源-> SQL Server。提供服务器和数据库后,在同一窗口中单击高级选项,将查询粘贴到打开的 SQL语句中。
选中使用完整层次结构导航,然后单击确定。

2.In Power BI Query Editor, select New Source-->SQL Server. After giving the server and database, in the same window click on "Advanced Options", paste the query in the "SQL Statement" that opened up. Check "Navigate using full hierarchy" and click OK.

3。您将看到仅在SP中传递的参数数据。

3.You will see data for the parameters you passed in SP only.


  1. 应用这些更改后,您将在Power BI Desktop中看到用于创建报告的数据集。

注意:此功能可在导入查询选项中使用。

NOTE: This works in"Import Query" option.

希望这对您有用对我来说,干杯!

Hope this works for you as it did for me, Cheers!

这篇关于如何在Microsoft PowerBI中使用SQL Server存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆