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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
win_anthony
Resolver III
Resolver III

Create Calculated Column Flagging Same ID from Another Connected Table

The goal is to create a calculated column in a table which will flag if a store number is present in another table. Both tables are connected together by the store number. I tried to use the following syntax but it will not work. Any advice on how to achieve the expected output will be greatly appreciated. 

Alerts Table
Store_Number
A1
B1
A2
B2

 

Shrink Table 
Store Number
A1
A2
A3
A4
A5
B1
B2
B3
B4
B5

 

Expected Output 
Shrink Table 
Store_NumberStore_Number Match From Alerts Table
A1YES
A2YES
A3 
A4 
A5 
B1YES
B2YES
B3 
B4 
B5 

 

IF(
    Shrink[Store Number] = RELATED(Alerts[STORE_NUMBER])
    ,"Yes"
)

storenumberlink2tables.png

 

 

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

@win_anthony 

Give this a try.  You would add it as a calculated column on your Shrink table.

Store_Number Match From Alerts Table =
IF ( COUNTROWS ( RELATEDTABLE ( Alerts ) ) > 0, "YES" )

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Enter this calculated column formula in the Shrink table

=if(shrink[store_number]=lookupvalue(Alerts[Store_number],Alerts[Store_number],shrink[store_number]),"yes",blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Enter this calculated column formula in the Shrink table

=if(shrink[store_number]=lookupvalue(Alerts[Store_number],Alerts[Store_number],shrink[store_number]),"yes",blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

The LOOKUPVALUE function will also work great in this situtation. 

jdbuchanan71
Super User
Super User

@win_anthony 

Give this a try.  You would add it as a calculated column on your Shrink table.

Store_Number Match From Alerts Table =
IF ( COUNTROWS ( RELATEDTABLE ( Alerts ) ) > 0, "YES" )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.