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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
m4xon
Helper III
Helper III

How to check if a value is present in the second table using measure or calculated column

Hi All,

 

I have a following problem, I have two tables in a one-to-many relationship, which means that one record from the first table may have several counterparts in the second table. I need to check if there is any "Yes" value in this second table for each ID in first table, if so, it should return TRUE, otherwise FALSE. Currently I solved that by creating CALCULATED TABLE through SUMMARIZE and I extract that information via USERELATIONSHIP calculated column, but I was wondering if I can do it more easily using just MEASURE or just calculated column directly from that table.

 

Thank you in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@m4xon , If you need a new column on one side table

New column = var _cnt = countx(filter(Table2, Table1[ID] = Table2[ID] && Table2[Value] = "Yes"), Table2[ID])
return
if(not(isblank(_cnt)), "Yes", "No")

 

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@m4xon , If you need a new column on one side table

New column = var _cnt = countx(filter(Table2, Table1[ID] = Table2[ID] && Table2[Value] = "Yes"), Table2[ID])
return
if(not(isblank(_cnt)), "Yes", "No")

 

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.