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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
pavkey88
New Member

Create a Calculated Column from Different Data sets

I'm having a bit of a struggle with this. 

 

I have one data set that contains productID and product unit price and another data set that contains productID and unit cost. I have them related so that I can see the product ID, unit price and unit cost in the report, but I want to create another (measured?) column for unit profit. this is what I'm trying:

 

Measure = SUM(ALLdata[Unit Price]-('display-cost-feb2016'[Cost]))

 

But it tells me the SUM function only accepts a column reference as an argument. Unit Price and Cost are both column names, just on 2 different data sets. What am I doing wrong?

 

thanks!

 

 

1 ACCEPTED SOLUTION
SqlJason
Memorable Member
Memorable Member

Your syntax has to be changed to

Measure = sum(Table1[column1]) - sum(Table2[column2])

 

Can you try this and let me know if it is ok?

View solution in original post

3 REPLIES 3
SqlJason
Memorable Member
Memorable Member

Your syntax has to be changed to

Measure = sum(Table1[column1]) - sum(Table2[column2])

 

Can you try this and let me know if it is ok?

I'm trying to do something similar to this but I'm calculating a share percentage so I'm dividing the two numbers (ex. sum(Table1[column1]) / sum(Table2[column2]). The problem I'm having is that the value from table 2 seems to have lost any reference it had to the year because my numbers are way off because it is using the grand total of the column 2 value for the division instead of just using the portion that belongs to a single year (see below).

DataSample.JPG

The _ITAVolume number for 2011 should be around 158,000.

 

Any assistance with this would be greatly appreciated.

Thanks @SqlJason - works perfectly. YAY!

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.