cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Return 'Yes' or 'No'/BLANK if value exists in related table

Hi,

 

I have two tables connected via 'project code'.

 

"Table A" and "Table B" (connected via project code)

 

I have made a simple table in my canvas with columns only from 'Table A'. Can I somehow make a calculated formula returning a Yes or a blank if the project code also appear in table B?

Thanks

Kristoffer

 

Project code:   date              sales       In table B?

Project 1          17Jun             4546         Yes

Project 2          24Jan            34646         Blank



 

 

1 ACCEPTED SOLUTION
Microsoft
Microsoft

HI @Kristofferaabo

 

You could try the following calculated measure.

 

In table B? = 
VAR MyProjectCode = MIN('Table A'[Project Code])
RETURN IF(
        COUNTX(
            FILTER(
                'Table B',
                'Table B'[Product Code] = MyProjectCode
                ),
                'Table B'[Product Code])>0,
                "Yes"
                )

image.png

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Microsoft
Microsoft

HI @Kristofferaabo

 

You could try the following calculated measure.

 

In table B? = 
VAR MyProjectCode = MIN('Table A'[Project Code])
RETURN IF(
        COUNTX(
            FILTER(
                'Table B',
                'Table B'[Product Code] = MyProjectCode
                ),
                'Table B'[Product Code])>0,
                "Yes"
                )

image.png

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Anonymous
Not applicable

This is brilliant. Thanks @Phil_Seamark  for the solution and @Kristofferaabo  for asking the question. 

Works great! exactly! thanks so much

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors