cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

M-Query Text Function

Hi Team,

 

I haven't get result in the below funcion from M-Query.

 

 

= Table.AddColumn(Rule1, "Rule2", each if(Text.Start([#"Temp (NTM)"] ,3) <> "DCL" or Text.Start([#"Temp (NTM)"],3) <> "DSA" or Text.Start([#"Temp (NTM)"] ,3) <> "DBC" ))
then "Placed"
else null)

 

Data look liks this,

 

screen.PNG

 

KV's

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: M-Query Text Function

Hi @Kalidass ,

 

Try this:

= Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([#"Temp(NTM)"], "DCL") then "" else if Text.StartsWith([#"Temp(NTM)"], "DSA") then "" else if Text.StartsWith([#"Temp(NTM)"], "DBC") then "" else "PLACED")

test_M-Query Text Function.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Highlighted
Super User IX
Super User IX

Re: M-Query Text Function

@Kalidass , what should happen, then is missing

Table.AddColumn(Rule1, "Rule2", each if(Text.Start([#"Temp (NTM)"] ,3) <> "DCL" or Text.Start([#"Temp (NTM)"],3) <> "DSA" or Text.Start([#"Temp (NTM)"] ,3) <> "DBC" then <> else <> ))

 

else is optional



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper IV
Helper IV

Re: M-Query Text Function

Hi @amitchandak ,

 

i have replaced my post.

 

Thanks,

KV's

Highlighted
Super User IX
Super User IX

Re: M-Query Text Function

@Kalidass , seem fine. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper IV
Helper IV

Re: M-Query Text Function

Hi @amitchandak ,

 

i can't paste my raw data so i shared my post in screenshot.

 

screen.PNG

 

please help me.

 

Thanks,

KV's

Highlighted
Super User IX
Super User IX

Re: M-Query Text Function

@Kalidass , I they should be and

Table.AddColumn(Rule1, "Rule2", each if(Text.Start([#"Temp (NTM)"] ,3) <> "DCL" and Text.Start([#"Temp (NTM)"],3) <> "DSA" and  Text.Start([#"Temp (NTM)"] ,3) <> "DBC" ))
then "Placed"
else null)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Microsoft
Microsoft

Re: M-Query Text Function

Hi @Kalidass ,

 

Try this:

= Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([#"Temp(NTM)"], "DCL") then "" else if Text.StartsWith([#"Temp(NTM)"], "DSA") then "" else if Text.StartsWith([#"Temp(NTM)"], "DBC") then "" else "PLACED")

test_M-Query Text Function.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors