cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
henriquemalone
Helper II
Helper II

Trouble to compare columns from differents table

Hello,

 

I am a beginner and am learning on my own and I really appreciate all the great knowlegde and support here. 

 

Well, i have the following tables:

 

Table A:

OrderBoxs
12345612
51891887
55695920
78771735

 

Table B

OrderPending
12345612
51891887
55695925
78771736

 

All i wanna do is compare the columns Boxs and Peding, like:

If(Boxs = Pending, "ok", "nok")

 

But i i dont how to do it because its 2 columns in different tables.

 

Someone can help me?

 

File:

https://drive.google.com/drive/folders/1HcMUlF0eddyPO6LA6XLgRR_mSwlsonSA?usp=sharing

 

Notes:

Table A = Base CL 10052021

Order = PL

Boxs = QTDE_CXS

 

Table B = SAP (2)

Order = PL

Pending = Pendente Faturamento

1 ACCEPTED SOLUTION
rajulshah
Solution Sage
Solution Sage

Hello @henriquemalone,

 

Please create a calculated column in Table A:

Pending PL =
VAR PendingOrders = LOOKUPVALUE('Sap (2)'[PL],'Sap (2)'[PL],'Base CL 10052021'[PL])
RETURN
IF(ISBLANK(PendingOrders), "nok", "ok")
 
I hope this works for you. Let me know if it doesn't.
Thanks.

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @henriquemalone ,

 

I agree with the solution given by @rajulshah  and tested it, and got the correct result:

v-henryk-mstf_0-1621242822551.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

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

Hi @v-henryk-mstf 

 

Hi @rajulshah 

 

It didnt work for me because i need to compare my columns Boxs x Pending, like

if( Boxs = Pending, "ok", "nok")

 

Your dax is just creating a column in my table A with the Orders Number from table B

Hi @henriquemalone ,

 

There is no error in the written formula. You need to understand the lookupvalue function. Its function is to retrieve the values that meet all the matching conditions from the table (and the matching condition in the above formula is whether Boxs = Pending), and the if function determines the value that meets the conditions. It is "ok", otherwise it is "nok".

 

For the detailed usage of the formula, please refer to the official document.LOOKUPVALUE function (DAX) - DAX | Microsoft Docs

Best Regards,
Henry

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

rajulshah
Solution Sage
Solution Sage

Hello @henriquemalone,

 

Please create a calculated column in Table A:

Pending PL =
VAR PendingOrders = LOOKUPVALUE('Sap (2)'[PL],'Sap (2)'[PL],'Base CL 10052021'[PL])
RETURN
IF(ISBLANK(PendingOrders), "nok", "ok")
 
I hope this works for you. Let me know if it doesn't.
Thanks.

View solution in original post

Hi @rajulshah 

 

It didnt work for me because i need to compare my columns Boxs x Pending, like

if( Boxs = Pending, "ok", "nok")

 

Your dax is just creating a column in my table A with the Orders Number from table B

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors