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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Gav
Frequent Visitor

Directquery table limitations

Greetings, PowerBI simpleton here ! I have a fairly straightword calculation to make but because the main table uses directquery this is turning into a challenge !

 

Rather than get bogged down with my implementation detail I've tried to simplify what I'm trying to do in the following description.

 

So my main table is a live stream of timestamped 'events', accessed using directquery, and I need to figure how many staff were around when each event occurs. My intention was to create a calculated column to add the staff number to the main table.

 

The staff numbers are within a separate 'operations' table, covering 24 hours, which identifies ranges in hours and staff number. This operations table is like this :-

 

start timeend timestaff
00:0006:001
06:0007:002
07:0010:003

 

So for each event in order to find the correct staff number I was simply going to use HOUR(timestamp), filter the operations table for rows with time of less than HOUR(timestamp) and use the row with the max time to the staff number . . .

but I can't do that because attempts to use MAXX fail because of directquery 😞

Any suggestions very much appreciated,

Gav

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Gav 

According to your requirement, you want to create a calculated column for a table whose connection mode is direct query.

However, direct query has great restrictions on calculated columns. For performance reasons, we do not recommend that you add calculated columns for direct query tables.

In order to add the staff number to the main table, I think you can try to achieve this in the original database (using stored procedure or ETL tools).

 

For more information about direct query, you can follow this link:

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-directquery-about

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

1 REPLY 1
v-robertq-msft
Community Support
Community Support

Hi, @Gav 

According to your requirement, you want to create a calculated column for a table whose connection mode is direct query.

However, direct query has great restrictions on calculated columns. For performance reasons, we do not recommend that you add calculated columns for direct query tables.

In order to add the staff number to the main table, I think you can try to achieve this in the original database (using stored procedure or ETL tools).

 

For more information about direct query, you can follow this link:

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-directquery-about

 

Best Regards,

Community Support Team _Robert Qin

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.