March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hello,
I would like to compare the strings of 2 tables A and B to the table Source:
TableSource
Code | Name | Serial number |
TE230 | SXMA | C231 |
TE231 | SXMB | C232 |
TE123 | SBFA | X765 |
TE432 | XSDR | X221 |
TE231 | SXMD | C232 |
TE432 | GFRG | D655 |
TE900 | FEDS | R400 |
TE888 | FEES | REDS |
TableA
Code | Name | Serial Number |
TE230 | SXMA | C231 |
TE231 | SXMD | C232 |
TE432 | GFRG | D655 |
TE900 | FEDS | R455 |
TE432 | XSDR | X221 |
TE231 | SXMB | C232 |
TE123 | SBAA | X700 |
TableB
Name | Serial Number |
SXMA | C231 |
SXMB | D233 |
GFRG | D699 |
FEDS | R455 |
XSDD | X221 |
SXMA | C232 |
XSDR | X221 |
SXMD | C232 |
GFRG | D655 |
The resuls should be somthing like below :
TableSource | |||||||
Code_Source | Name_Source | Serial number_Source | Code_A | Name_A | Serial Number_A | Name_B | Serial Number_B |
TE230 | SXMA | C231 | TE230 | SXMA | C231 | SXMA | C231 |
TE231 | SXMB | C232 | TE231 | SXMB | C232 | SXMB | D233 |
TE123 | SBFA | X765 | TE123 | SBAA | X700 | ||
TE432 | XSDR | X221 | TE432 | XSDR | X221 | XSDR | X221 |
TE231 | SXMD | C232 | TE231 | SXMD | C232 | SXMD | C232 |
TE431 | GFRG | D655 | GFRG | D655 | |||
TE900 | FEDS | R400 | TE900 | FEDS | R455 | FEDS | R455 |
TE888 | FEES | REDS |
The table A and Table source will compared based on the column "Code", the table B doesn't have column "Code", so it will be based on the column "Name"
Could you please advise ?
Many thanks in advance.
Tg
Solved! Go to Solution.
Hi @vnqtrang ,
You can try like below:
M1_name =
IF ( MAX ( 'TableSource'[Name] ) <> MAX ( 'TableA'[NameA] ), "red", "black" )
M1_serial =
IF(MAX('TableSource'[Serial number]) <> MAX('TableA'[Serial Number_A]), "red" ,"black")
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 @vnqtrang ,
You can try like below:
M1_name =
IF ( MAX ( 'TableSource'[Name] ) <> MAX ( 'TableA'[NameA] ), "red", "black" )
M1_serial =
IF(MAX('TableSource'[Serial number]) <> MAX('TableA'[Serial Number_A]), "red" ,"black")
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.
Thank you for your reply.
Could you please advise how I could count the different cases ? It means counting the 0 in each measure.
Tg
@vnqtrang Sorry, you lost me. What are you going for, conditional formatting like you showed in your screen shot or the count of items that don't match or actually displaying the codes that don't match or ???
@vnqtrang Assuming relationships between the tables you could create measures like this for flagging used in conditional formatting:
Measure Flag =
VAR __Name = MAX('TableSource'[Name])
VAR __TableAName = MAX('TableA'[Name])
RETURN
IF(__Name = __TableAName, 1, 0)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |