Forum Discussion
phaering
6 years agoHelper I
Using DAX Search to find separate partial values in multiple columns
I am trying to create a new column that provides a simplified naming for an operating system (OS) running on a server. I have two columns from my source data that provide the OS version and name. I...
- 6 years ago
Hi phaering ,
Try this:
Column = SWITCH ( TRUE (), SEARCH ( "Win2008R2", [OS],, -1 ) <> -1 ----------------------"<> -1" is missing in your expression. && SEARCH ( "Enterprise", [OS_Full_Name],, -1 ) <> -1, "Win 2008 R2 Ent", SEARCH ( "Win2008", [OS],, -1 ) <> -1 ----------------------"<> -1" is missing in your expression. && SEARCH ( "Standard", [OS_Full_Name],, -1 ) <> -1, "Win 2008 Std", SEARCH ( "Linux Red Hat Enterprise Server 7.8", [OS],, -1 ) <> -1, "Red Hat 7.8", SEARCH ( "SunOS 5.10", [OS],, -1 ) <> -1, "SunOS 5.10" )BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Thank you very much! I never thought to include the "<> -1" in both parts. Much appreciated, this worked.
Icey
6 years agoCommunity Support
Hi phaering ,
Try this:
Column =
SWITCH (
TRUE (),
SEARCH ( "Win2008R2", [OS],, -1 ) <> -1 ----------------------"<> -1" is missing in your expression.
&& SEARCH ( "Enterprise", [OS_Full_Name],, -1 ) <> -1, "Win 2008 R2 Ent",
SEARCH ( "Win2008", [OS],, -1 ) <> -1 ----------------------"<> -1" is missing in your expression.
&& SEARCH ( "Standard", [OS_Full_Name],, -1 ) <> -1, "Win 2008 Std",
SEARCH ( "Linux Red Hat Enterprise Server 7.8", [OS],, -1 ) <> -1, "Red Hat 7.8",
SEARCH ( "SunOS 5.10", [OS],, -1 ) <> -1, "SunOS 5.10"
)
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
phaering
6 years agoHelper I
Thank you very much! I never thought to include the "<> -1" in both parts. Much appreciated, this worked.