Forum Discussion
SarathB2
4 years agoFrequent Visitor
Need help with Dax
Hello Experts, Good Day! I am stuck with finding and extract the values from a column which "StartsWith" any of the value from another column which are true. Example - I have two tables with o...
- 4 years ago
SarathB2 , Try like
Flag =
VAR SO = Table2[Object]
VAR _Tab = maxx(FILTER(Table1, CONTAINSSTRING(LEFT(SO,LEN(Table1[Type])),Table1[Type])), Table[Type])
RETURN
_tab
SarathB2
4 years agoFrequent Visitor
Hello amitchandak , Fowmy
In my case , one of Type is "ANG"
when i try to search that one "ANGULAR" also consedering in Object as pass as it is staring with ANG.
how to avoid this .....
I tried to give a space after ANG like "ANG " but when its come to Desktop its not taking the space .
Please assist,
Thanks in advance.
Fowmy
Super User
4 years agoSarathB2
I modified my code, now you do not need the Flag column.
Item =
VAR SO = Table2[Object]
VAR Tab = VALUES('Table1'[Type] )
VAR Obj =
IF( SEARCH(" ", Table2[Object],1,BLANK()) = BLANK(),
Table2[Object],
TRIM(LEFT( Table2[Object] , SEARCH(" ", Table2[Object],1,BLANK()) ))
)
VAR Result =
MAXX( FILTER(ALL('Table1'[TYPE]), Table1[Type] = OBJ) , Table1[Type] )
RETURN
Result