Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GFRO
Frequent Visitor

Native Database Query Error

I'm having this Expression.Error: This native database query isn't currently supported.

I declared some variables to update some dates in the Main Query.

Does anyone have an idea what's wrong here? It works fine when I run it in SQL Server.

 

 

DECLARE @Start_Date DATE, @End_Date DATE, @Update_Date DATE, @Pay_Date DATE, @NextStart_Date DATE;

SELECT
@Start_Date =   dateadd(day, -1 * DATEPART(dy,SYSDATETIME()) % 14 , SYSDATETIME())
SET @End_Date = dateadd(DAY , 13,@Start_Date)
SET @Pay_Date = dateadd(DAY , 19,@Start_Date)
SET @Update_Date = dateadd(day,-7, @End_Date )
SET @NextStart_Date = dateadd(day,14, @Start_Date)


IF @Update_Date >= convert(date, SYSDATETIME() ) AND @NextStart_Date <= convert(date, SYSDATETIME()) 
BEGIN
<Main Query here>
END

 

 

 

1 REPLY 1
v-zhangtin-msft
Community Support
Community Support

Hi, @GFRO 

 

Is the problem occurring in Power BI Desktop or Power BI Service?

Please check if  this thread helps:

Solved: Native Database Query Error - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.