Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all ,
I have table similar to the below.
I need to have have column that check if column 2 & 3 are identical - easy
I also need to have column that show the differnce between the columns
e.g.
1 identical
2 A - missing A
3 A - additional A
4 - , - additional ,
5 - space
is it possible to acheive with PQ / DAX ?
Column1Column2Column3
1 | AAA | AAA |
2 | AAA | AA |
3 | AAA | AAAA |
4 | AB | AB, |
5 | AAA | A A |
Solved! Go to Solution.
Hi @nirrobi,
You can add a custom column in Query Editor:
if ([Column1] = [Column2]) then "identical" else if (Text.Length([Column1]) > Text.Length([Column2])) then Text.Replace([Column1], [Column2], "") &"- missing "& Text.Replace([Column1], [Column2], "") else if (Text.Length([Column1]) < Text.Length([Column2])) then Text.Replace([Column2], [Column1], "") &"- additional "& Text.Replace([Column2], [Column1], "") else ""
This solves everything except point 5 in your example, but it's a good approach.
Regards.
Hi @nirrobi,
You can add a custom column in Query Editor:
if ([Column1] = [Column2]) then "identical" else if (Text.Length([Column1]) > Text.Length([Column2])) then Text.Replace([Column1], [Column2], "") &"- missing "& Text.Replace([Column1], [Column2], "") else if (Text.Length([Column1]) < Text.Length([Column2])) then Text.Replace([Column2], [Column1], "") &"- additional "& Text.Replace([Column2], [Column1], "") else ""
This solves everything except point 5 in your example, but it's a good approach.
Regards.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |