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
Rene34324
Frequent Visitor

the expression contains columns from multiple tables, but only columns from a single table

 

MateriaalKostenNederlandTekstArt = 
CALCULATE(
    SUM('C1-REV-DouaneMateriaalKosten'[TotalCost]),
    ( 'C1-RV-TekstArtikel-Jobnum-WO-Vendor'[Country] = "Nederland" && 'C1-REV-DouaneMateriaalKosten'[PartClassDescription] = "TekstArtikel"))

 

 gives the error : the expression contains columns from multiple tables, but only columns from a single table.
Does any one have an idea how i can perform this action ? Calculate TotalCost with Filtered values from two different tables ?

In de model the two tables are related on jobnum:
mdl.PNG

Thank you

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

MateriaalKostenNederlandTekstArt = 
CALCULATE(
    SUM('C1-REV-DouaneMateriaalKosten'[TotalCost]),
    'C1-RV-TekstArtikel-Jobnum-WO-Vendor'[Country] = "Nederland",
    'C1-REV-DouaneMateriaalKosten'[PartClassDescription] = "TekstArtikel")

 

I think you will want to spend some time with your data model. It is not in a usable shape at the moment.

View solution in original post

4 REPLIES 4
Rene34324
Frequent Visitor

Thank you
@lbendlin The measure you corrected measure does work.
I cannot change much on the datamodel since they come from existing views which i tied together.






lbendlin
Super User
Super User

MateriaalKostenNederlandTekstArt = 
CALCULATE(
    SUM('C1-REV-DouaneMateriaalKosten'[TotalCost]),
    'C1-RV-TekstArtikel-Jobnum-WO-Vendor'[Country] = "Nederland",
    'C1-REV-DouaneMateriaalKosten'[PartClassDescription] = "TekstArtikel")

 

I think you will want to spend some time with your data model. It is not in a usable shape at the moment.

@lbendlin  
Can you clarify your  statement below ? Thank you.
I think you will want to spend some time with your data model. It is not in a usable shape at the moment.

Power BI prefers star schema data models, with clearly identified dimension and fact tables in a 1:* single direction relationship (the dimension controlling the fact).  Avoid limited relationships and bidirectional *:* where possible.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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