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
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
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.