Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |