Forum Discussion
Vlookup - PowerBI - Text range or list
- 4 years ago
Hi jaimemagana ,
You can convert the text to UniCode and then compare them.
1. First add a new column to table.NumberCode = UNICODE ( 'Table'[3Letters] ) * 10000 + UNICODE ( MID ( 'Table'[3Letters], 2, 1 ) ) * 100 + UNICODE ( RIGHT ( 'Table'[3Letters] ) )2. Then create the column in plate table.
Lookup = VAR Fir = UNICODE ( [3Letters] ) VAR Sec = UNICODE ( MID ( [3Letters], 2, 1 ) ) VAR Thir = UNICODE ( RIGHT ( [3Letters] ) ) VAR PlateUnicode = Fir * 10000 + Sec * 100 + Thir VAR Tab = FILTER ( 'Table', 'Table'[NumberCode] = MAXX ( FILTER ( 'Table', [NumberCode] <= PlateUnicode ), [NumberCode] ) ) RETURN MAXX ( Tab, [Attribute] ) & " " & MAXX ( tab, [Year] )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi jaimemagana ,
You can convert the text to UniCode and then compare them.
1. First add a new column to table.
NumberCode =
UNICODE ( 'Table'[3Letters] ) * 10000
+ UNICODE ( MID ( 'Table'[3Letters], 2, 1 ) ) * 100
+ UNICODE ( RIGHT ( 'Table'[3Letters] ) )
2. Then create the column in plate table.
Lookup =
VAR Fir = UNICODE ( [3Letters] )
VAR Sec = UNICODE ( MID ( [3Letters], 2, 1 ) )
VAR Thir = UNICODE ( RIGHT ( [3Letters] ) )
VAR PlateUnicode = Fir * 10000 + Sec * 100 + Thir
VAR Tab =
FILTER (
'Table',
'Table'[NumberCode]
= MAXX ( FILTER ( 'Table', [NumberCode] <= PlateUnicode ), [NumberCode] )
)
RETURN
MAXX ( Tab, [Attribute] ) & " " & MAXX ( tab, [Year] )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.