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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Create a new measure based on conditions in another table

Hello

 

I would like to create a measure to calculate the costs for each employee in Table A, based on information in Table B, shown below

ZHC_0-1713493299789.png

The two tables are linked by Z_Division_SK in both tables.

 

What I want to do is that, if an employ in team "Sales" in Table B, the cost of the employee at that time = "Travel Distance" * 1.69, otherwise = "Travel Distance" *1.35

 

I use the following

Costs =
IF(
 RELATED('Table B' [Team])= "Sales",
SUMX('Table A',[Travel Distance]*1.69),

SUMX('Table A',[Travel Distance]*1.35))

 

Then I got error message saying Table B doesn't exist or doesn't have relationship with Table A

 

The data I use for the calculation is not directly linked but the two tables are linked.

Is my task achievable? 

 

Your help is much apprecated. Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solved the issue. Rather than creating a measure, I create a new colunm. Then it works well.

Thank you for your attendation.

View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

pls provide update the sample data. We need the columns that can be linked between two tables and what's the expected output? that will help us to check if the solution is correct.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I solved the issue. Rather than creating a measure, I create a new colunm. Then it works well.

Thank you for your attendation.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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