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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bcap01
Helper II
Helper II

Simple JOIN

Hello,

 

I am a PowerBI/DAX newbie. I am looking to understand how to JOIN two tables to do a simple calculation. 

 

For example, lets say I have two tables Invoices and Costs that JOIN based on JobID.  

 

Invoice Table -  SELECT JobID, InvoiceAmt FROM Invoices

Cost Table - SELECT JobID, Cost FROM Costs

 

In DAX Format I would like to join these 2 tables to show the calculation:  GP = [InvoiceAmt] - [Cost]

 

WHat I have tried is the following but got error message.

 

GP = (Invoice[InvoiceAmt]) - (Costs[Cost])

 

Any help is sincerely appreciated!

 

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

HI @bcap01,

You cannot directly use different table columns in one formula, you can try to reference or use current table value to lookup corresponds table values and use this in calculations.

Using RELATED and RELATEDTABLE in DAX - SQLBI

Power BI Compares Two Columns in Different Tables - SPGuides

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @bcap01,

You cannot directly use different table columns in one formula, you can try to reference or use current table value to lookup corresponds table values and use this in calculations.

Using RELATED and RELATEDTABLE in DAX - SQLBI

Power BI Compares Two Columns in Different Tables - SPGuides

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
bcap01
Helper II
Helper II

the error message i am getting is, "A single value for column '' in table '' caanot be determined. This can happen when a measure formula refers to a column that contains values without specifiying an aggregation..."

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.