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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Analmd
Regular Visitor

This step results in a query that is not supported in DirectQuery mode

Hi All,

I have connected to a Power BI semantic model (Model A) using DirectQuery mode. Additionally, I am using the Import mode to connect to another dataset (Dataset B) and performing various transformations, such as applying filters. These transformations are working as expected. However, when I attempt to use the function to add a column:

Date.EndOfWeek([deliverydate](__CITATION__1),1)

, I encounter the following error: "This step results in a query that is not supported in DirectQuery mode."

 

To investigate further, I altered the sequence in which I connected the datasets. By importing Dataset B first via Import mode and then connecting to Model A using DirectQuery mode afterward, everything worked correctly.

 

Does anyone have any insights into why this might be happening? Your help would be greatly appreciated!

2 ACCEPTED SOLUTIONS
MasonMA
Resident Rockstar
Resident Rockstar

hello @Analmd 

 

In your second approach, it looks Power BI treats the Import table as a local source and allows more flexible transformations. Then when you connect to Model A via DirectQuery, Power BI can isolate the DirectQuery logic and avoid unsupported transformations.

 

 

If you need something like Date.EndOfWeek, do it via DAX calculated column in the model instead of Power Query.

 
EndOfWeek = ENDOFWEEK('Table'[deliverydate], SUNDAY)

 

View solution in original post

Shahid12523
Community Champion
Community Champion

You're seeing that error because Date.EndOfWeek is an M function, and DirectQuery mode can't translate it into SQL. When you connect to the DirectQuery source first, Power BI enforces stricter rules. But if you connect the Import source first, it relaxes those rules slightly.


Quick fix: Use DAX instead of M:
EndOfWeek = [deliverydate] + (7 - WEEKDAY([deliverydate], 2))


Or preprocess the column in the source system.

Shahed Shaikh

View solution in original post

2 REPLIES 2
Shahid12523
Community Champion
Community Champion

You're seeing that error because Date.EndOfWeek is an M function, and DirectQuery mode can't translate it into SQL. When you connect to the DirectQuery source first, Power BI enforces stricter rules. But if you connect the Import source first, it relaxes those rules slightly.


Quick fix: Use DAX instead of M:
EndOfWeek = [deliverydate] + (7 - WEEKDAY([deliverydate], 2))


Or preprocess the column in the source system.

Shahed Shaikh
MasonMA
Resident Rockstar
Resident Rockstar

hello @Analmd 

 

In your second approach, it looks Power BI treats the Import table as a local source and allows more flexible transformations. Then when you connect to Model A via DirectQuery, Power BI can isolate the DirectQuery logic and avoid unsupported transformations.

 

 

If you need something like Date.EndOfWeek, do it via DAX calculated column in the model instead of Power Query.

 
EndOfWeek = ENDOFWEEK('Table'[deliverydate], SUNDAY)

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors