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

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

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

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

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

2 REPLIES 2
Phil_Seamark Super Contributor
Super Contributor

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

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

Highlighted

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

Works great! exactly! thanks so much

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 176 members 1,983 guests
Please welcome our newest community members: