Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Folks,
I'm trying to create a new query that will search through a column looking for cells that contain specific text. I'm using the SWITCH function and so far its working great. Example.
NewColumn =
SWITCH(
TRUE(),
TABLE1[ProcessColumn]="process.exe","Process Application",
BLANK()
)
I would now like to add a search function this time as I want to find cells that may contain the text that I'm looking for. Basically like a wildcard or Like oeprator. I've got this so far.
SWITCH (
TRUE (),
SEARCH ( "apache", 'TABLE1'[ProcessColumn],, 0 ) = 1, "Process Application",
BLANK()
)
It then throws me this error.
To use special characters in a column name, enclose the entire name in brackets ( [] ) and add a ] to any closing brackets in the name.
It could be something very obvious that I've done wrong but I've spent some time trying to get the right syntax and it still doesn't like it. Any ideas? Any help would be appreciated.
Thanks.
Solved! Go to Solution.
Hi @mkrmenci,
I have made a test with your dax expression in Power BI Desktop (Version: 2.56.5023.942 64-bit (March 2018)), everything works well. It seems that your formula should be right,
Please check if you have update the latest Power BI Desktop.
By the way, what is your data source and how do you connect it?
In addition, you could have a reference of my test pbix file.
Best Regards,
Cherry
Hi @mkrmenci,
I have made a test with your dax expression in Power BI Desktop (Version: 2.56.5023.942 64-bit (March 2018)), everything works well. It seems that your formula should be right,
Please check if you have update the latest Power BI Desktop.
By the way, what is your data source and how do you connect it?
In addition, you could have a reference of my test pbix file.
Best Regards,
Cherry
Hey @v-piga-msft ,
This solution seems to be working for me but with >1, instead of =1 : not sure why.
I also am not clear what is True() and Blank() doing in the code - those are not standard parameters for the SWITCH function, right?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |