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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anpo
New Member

Error: A calculated column or RLS expression on a DirectQuery table cannot reference tables...

I am trying to apply RLS in a semantic model and I keep getting the following error:

" A calculated column or RLS expression on a DirectQuery table cannot reference tables from a different data source. "

 

However, the expression uses tables that are located in the same data source.

 

Any suggestions?

 

Thanks

 

 

2 REPLIES 2
Shahid12523
Kudo Collector
Kudo Collector

The error happens if your model mixes sources (e.g., multiple connections or Import + DirectQuery).
Fix: ensure all RLS tables come from the same DirectQuery source and avoid calculated columns on DirectQuery tables. Use relationships/bridge tables instead.

rohit1991
Super User
Super User

Hi @Anpo 

 

This error happens because in DirectQuery mode, RLS or calculated columns can only reference tables from the same source group and with the same storage mode. Even if both tables point to the same database, if they were loaded through different connections (separate “Source” steps in Power Query) or if one is Import and the other is DirectQuery, Power BI treats them as different sources. To fix it, make sure all the tables used in your RLS filter come from a single connection (use “Reference” instead of creating new queries), and set their storage mode consistently (DirectQuery or Dual). If cross-table logic is unavoidable, push the filter to the database (views/security filters) or handle it with measures instead of calculated columns.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors