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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Super User
Super User

Hello @Anonymous,

 

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 @Anonymous ,

 

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.

Anonymous
Not applicable

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 @Anonymous ,

 

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
Super User
Super User

Hello @Anonymous,

 

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

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.