Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello - i want to create an an indicator that lets me know if 2 strings have any of the same characters. This value can return anything - TRUE/FALSE, or a count of matching characters, "Y"/"N", etc.
Examples:
"123A" v "ABC" would return TRUE
"AZ4" vs "983" would return FALSE
"150BE" vs "IZF" would return FALSE
"AMZY1" vs "M25?1" would return TRUE
Try this:
col =
VAR FirstWord =
LOWER ( Colors[Colors] )
VAR SecondWord =
LOWER ( Colors[Column] )
VAR FirstWordNumSeries =
GENERATESERIES ( 1, LEN ( FirstWord ), 1 )
VAR SecondWordNumSeries =
GENERATESERIES ( 1, LEN ( SecondWord ), 1 )
VAR FirstWordCharacters =
SELECTCOLUMNS (
ADDCOLUMNS ( FirstWordNumSeries, "FW", MID ( FirstWord, [Value], 1 ) ),
"@FW", [FW]
)
VAR SecondWordCharacters =
SELECTCOLUMNS (
ADDCOLUMNS ( SecondWordNumSeries, "SW", MID ( SecondWord, [Value], 1 ) ),
"@SW", [SW]
)
VAR Result =
IF (
COUNTROWS ( FILTER ( FirstWordCharacters, [@FW] IN SecondWordCharacters ) ) > 0,
TRUE (),
FALSE ()
)
RETURN
Result
Hi @Anonymous ,
Are these 2 string separate Columns ?
Regards,
HN
one is a column, the other is a measure
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |