Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Really I don´t know how to manage this, I am trying to use a simple stored procedure (for now) with 2-date parameters.
CREATE PROC usp_Sel_Reporte_Indicadores @dtFechaIni DATE = NULL, @dtFechaFin DATE = NULL
AS
IF @dtFechaIni = NULL
SET @dtFechaIni = GETDATE()
IF @dtFechaFin = NULL
SET @dtFechaIni = GETDATE()
---Tiempo Disponible
SELECT *
FROM dbo.DC_VW_Paros
WHERE Fecha BETWEEN @dtFechaIni AND @dtFechaFin
this is my connection instruction:
let
Source = Sql.Database(Sqlnstance, Database, [Query="EXEC usp_Sel_Reporte_Indicadores '" & Date.ToText(FechaIni,"yyyyMMdd") & "','" & Date.ToText( FechaFin,"yyyyMMdd") & "'"])
in
Source
With these 2 parameters
And in the Query Editor works correctly ,but when I close & apply changes show me this error
I appreciate any idea
Solved! Go to Solution.
Hi redexecutive,
I have confirmed this issue from PG. Actually, this is another limitation of DirectQuery that does not permit to use a store procedure.
Only queries with the form Select … From … Where … are allowed.
Best Regards,
Jimmmy
Hi redexecutive,
I have reproduced your issue, I made a simple table and created a procedure usp_Sel_Reporte_Indicadores with your script in SQL Server.
Fisrtly I tested import mode, I created 4 parameters like yours and created a new query with your script.
It worked well in Query Editor and after I clicked “close&apply” button there was no error.
However, when I test in direct query mode, I encountered the same error with you after clicking “apply” button like below:
After that I modified my SP with no input params, the error still existed. It seems that there are some limitations with SQL query in direct query mode(e.g.:maybe don’t support execute SP)
I have sent a mail to PG to confirm this issue. Currently, as a workaround, you can use import mode instead of direct query mode.
Regards,
Jimmy Tao
Thanks v-yuta-msft for your quick answer, but my client need the information online, and there are a lot of calculations there. 😞
Regards
Hi redexecutive,
I have confirmed this issue from PG. Actually, this is another limitation of DirectQuery that does not permit to use a store procedure.
Only queries with the form Select … From … Where … are allowed.
Best Regards,
Jimmmy
What happens if you change the date format from "yyyyMMdd" to "yyyy-MM-dd" ?
Hi:
Thanks for answer but throws this error
"Expression.Error: This native database query isn't currently supported."
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |