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
Anonymous
Not applicable

Check if Value Exits on another table/colum and display message.

I have table 1 that lists project ID's.  I have table 2 which has subset of Project IDs.  How do I check if the "selected project" from table 1 exists in table 2 and display a message if true. (ex: "Project Exists")

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create calculated column in Table1 like DAX below.

 

Column1 = IF(ISBLANK(LOOKUPVALUE(Table2[ProjectID],Table2[ProjectID],Table1[ProjectID])) , BLANK(), "Project Exists")

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create calculated column in Table1 like DAX below.

 

Column1 = IF(ISBLANK(LOOKUPVALUE(Table2[ProjectID],Table2[ProjectID],Table1[ProjectID])) , BLANK(), "Project Exists")

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FrankAT
Community Champion
Community Champion

Hi @Anonymous 

you can check this with Power Query if you merge these two tables with the inner join like this:

 

 

// Table 1
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjAwVIrVAdEmUNoISltAaEMDpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t])
in
    Source

// Table 2
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjAwUYrVAdHGUNpCKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t])
in
    Source

// Projects
let
    Source = Table.NestedJoin(#"Table 1", {"Project"}, #"Table 2", {"Project"}, "Table 2", JoinKind.Inner),
    #"Removed Columns" = Table.RemoveColumns(Source,{"Table 2"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Project", "Concurrent Project"}})
in
    #"Renamed Columns"

 

 

25-08-_2020_22-56-40.png

 

Regards FrankAT

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.