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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Thimma
Frequent Visitor

DAX help

Hi,

 

I have two tables, one contain master table of ID (Table 1) and another table (Table 2) contains details of fact including ID.

 

Now I want to cross check whether ID from table 1 are present in table 2 or not. There is no join between two tables. I want to create a column that give whether it is exist in table 2 or not. My report is ID from table 1 and other columns from table 2. so that I will have all ID's from table 1 and will not miss any records if it is not present in table 2.

 

any workaround pls.

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Thimma 

 

You can solve this with LOOKUPVALUE(). Please find the example below

 

I have to table (Product and Customer). TRhey are not connected. Product ahs a ID column 1-6 and customer has an ID column 1-5.

Mikelytics_4-1671013122708.png

 

Product Table

Mikelytics_3-1671013113927.png

 

Customer Table

Mikelytics_2-1671013057941.png

 

Now I created in the product table the following calculated column:

LookUp ID= 
var varLookUpValue = LOOKUPVALUE(Dim_Customer[PK_CustomerID],Dim_Customer[PK_CustomerID],[PK_ProductID])
RETURN
IF(NOT ISBLANK(varLookUpValue),1,0)

 

Result

Mikelytics_5-1671013152400.png

 

Best regards

Michael

-----------------------------------------------------

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

Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

1 REPLY 1
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Thimma 

 

You can solve this with LOOKUPVALUE(). Please find the example below

 

I have to table (Product and Customer). TRhey are not connected. Product ahs a ID column 1-6 and customer has an ID column 1-5.

Mikelytics_4-1671013122708.png

 

Product Table

Mikelytics_3-1671013113927.png

 

Customer Table

Mikelytics_2-1671013057941.png

 

Now I created in the product table the following calculated column:

LookUp ID= 
var varLookUpValue = LOOKUPVALUE(Dim_Customer[PK_CustomerID],Dim_Customer[PK_CustomerID],[PK_ProductID])
RETURN
IF(NOT ISBLANK(varLookUpValue),1,0)

 

Result

Mikelytics_5-1671013152400.png

 

Best regards

Michael

-----------------------------------------------------

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

Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.