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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

 

 

1 ACCEPTED SOLUTION
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!

View solution in original post

5 REPLIES 5
v-echaithra
Community Support
Community Support

Hi @Anpo ,

May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

Thank you.

v-echaithra
Community Support
Community Support

Hi @Anpo ,

We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

Best Regards,
Chaithra E.

v-echaithra
Community Support
Community Support

Hi @Anpo ,

Thank you @Shahid12523 , @rohit1991  for your inputs.

I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.

Thank you.

Shahid12523
Community Champion
Community Champion

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.

Shahed Shaikh
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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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