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
KimberlyHM
Frequent Visitor

New Column: If other table contains value

Hi guys!

 

Hopefully you can help with creating a measure 🙂

I want to add a New column in the Data tab in Table1 (could also maybe be the Power Query?). I have two data tables:

 

Table1 has 1 ID per row:

KimberlyHM_3-1645540887909.png

 

Table2 has multiple rows per ID with different data in the f.e. 'Weighting' or 'Zero Section' column:

KimberlyHM_4-1645540923887.png

 

What do I want? In Table1 I want to have an New column that has a Yes/No data. For example for row with ID 32:

If ID 32 has in Table2 in the column 'Zero Section' only "no"'s, then put "no" in the New column in Table1. If ID 32 has in Table2 in the column 'Zero Section' a "yes" then put "yes" in the New column in Table1.

 

Any ideas?

 

Greetings Kimberly

 

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@KimberlyHM,

 

Try this calculated column in Table1:

 

New Column =
VAR vID = Table1[ID]
VAR vTable =
    FILTER ( Table2, Table2[ID] = vID && Table2[Zero Section] = "yes" )
VAR vResult =
    IF ( ISEMPTY ( vTable ), "no", "yes" )
RETURN
    vResult




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@KimberlyHM,

 

Try this calculated column in Table1:

 

New Column =
VAR vID = Table1[ID]
VAR vTable =
    FILTER ( Table2, Table2[ID] = vID && Table2[Zero Section] = "yes" )
VAR vResult =
    IF ( ISEMPTY ( vTable ), "no", "yes" )
RETURN
    vResult




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

Proud to be a Super User!




Yes this worked perfectly, thank you!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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