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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ZHC
Regular Visitor

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

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!




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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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