<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Importing Stored Procedure + Dynamic Date Parameter in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Importing-Stored-Procedure-Dynamic-Date-Parameter/m-p/2760797#M38580</link>
    <description>&lt;P&gt;I'm new to to Power BI and I've been researching how to import Stored Procedure's from Get Data query in PBI and someone said that the easiest way is to Execute in SQL Server, then copy in the execution code, as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DECLARE	@return_value int

EXEC	@return_value = [Reporting].[WallerNumbers]
		@TimeZoneID = 1,
		@TZStartDate = @start,
		@TZEndDate = @end,
		@DateType = 3

SELECT	'Return Value' = @return_value

EXEC	@return_value = [Reporting].[XXXXX]
		@TimeZoneID = 1,
		@TZStartDate = N'2022-09-01',
		@TZEndDate = N'2022-09-12',
		@DateType = 3

SELECT	'Return Value' = @return_value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine but I have 2 questions from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Is this the best way to import into Power BI from a Stored Procedure?&lt;/P&gt;&lt;P&gt;2) How can I manipulate this to have the TZEndDate paramater be dynamic i.e.., getdate()? If I was using SSRS I would hard code this in the report parameters&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 05:06:38 GMT</pubDate>
    <dc:creator>andyor</dc:creator>
    <dc:date>2022-09-12T05:06:38Z</dc:date>
    <item>
      <title>Importing Stored Procedure + Dynamic Date Parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Importing-Stored-Procedure-Dynamic-Date-Parameter/m-p/2760797#M38580</link>
      <description>&lt;P&gt;I'm new to to Power BI and I've been researching how to import Stored Procedure's from Get Data query in PBI and someone said that the easiest way is to Execute in SQL Server, then copy in the execution code, as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DECLARE	@return_value int

EXEC	@return_value = [Reporting].[WallerNumbers]
		@TimeZoneID = 1,
		@TZStartDate = @start,
		@TZEndDate = @end,
		@DateType = 3

SELECT	'Return Value' = @return_value

EXEC	@return_value = [Reporting].[XXXXX]
		@TimeZoneID = 1,
		@TZStartDate = N'2022-09-01',
		@TZEndDate = N'2022-09-12',
		@DateType = 3

SELECT	'Return Value' = @return_value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine but I have 2 questions from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Is this the best way to import into Power BI from a Stored Procedure?&lt;/P&gt;&lt;P&gt;2) How can I manipulate this to have the TZEndDate paramater be dynamic i.e.., getdate()? If I was using SSRS I would hard code this in the report parameters&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 05:06:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Importing-Stored-Procedure-Dynamic-Date-Parameter/m-p/2760797#M38580</guid>
      <dc:creator>andyor</dc:creator>
      <dc:date>2022-09-12T05:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Stored Procedure + Dynamic Date Parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Importing-Stored-Procedure-Dynamic-Date-Parameter/m-p/2760892#M38583</link>
      <description>&lt;P&gt;The solution is to declare and set these in the import statement E.g.,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DECLARE	@return_value int
DECLARE @start datetime
DECLARE @end datetime

SET @start = DATEADD(Day, 0, DATEDIFF(Day, 0, GetDate()))
SET @end = getdate()

EXEC	@return_value = [Reporting].[XXXXX]
		@TimeZoneID = 1,
		@TZStartDate = @start,
		@TZEndDate = @end,
		@DateType = 3

SELECT	'Return Value' = @return_value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 05:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Importing-Stored-Procedure-Dynamic-Date-Parameter/m-p/2760892#M38583</guid>
      <dc:creator>andyor</dc:creator>
      <dc:date>2022-09-12T05:06:54Z</dc:date>
    </item>
  </channel>
</rss>

