Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
LD1
Helper III
Helper III

Function IF error in add step

Hi everyone, 

 

I would like to add a new step in my table with "IF containsstring" function.

I mean : 

Currently i use "if([main table]="text","text",[resultat from on other table].

I tried with the formula "Containsstring" combined with IF but the result is not clear (message error bellow).

I am not sur but in "create new step" logic is different and i tried to work with "if, then, else" 

I try to combine 2 data that come from 2 different columns

It doesn't seem to work.

 

LD1_1-1657704087592.png

 

I hope I am clear.

Thank you in advance for your help,

 

LD

 

 

 

 

3 ACCEPTED SOLUTIONS
Vijay_A_Verma
Super User
Super User

PQ is super case sensitive.

Following changes are required

1. IF needs to be replaced with if

2. = in Text.Contains needs to be replaced with comma

Hence, in your custom column, you need to input following

 

= if Text.Contains([#"Format commercial regroupé"],"DIGITAL") then "DOOH" else [#"Type d'activité"]

 

View solution in original post

IF in power query should be "if" (lowercase) and IF in DAX is uppercase. I appreciate this is confusing, has caught me out a few times too. 

 

The "=" sign won't work as Text.Contains takes in two parameters (seperated by a column). Just replace the "=" with a "," and you'll be all good. Good luck!

 

View solution in original post

v-stephen-msft
Community Support
Community Support

Hi @LD1 ,


Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.


Best Regards,
Stephen Tao

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @LD1 ,


Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.


Best Regards,
Stephen Tao

IF in power query should be "if" (lowercase) and IF in DAX is uppercase. I appreciate this is confusing, has caught me out a few times too. 

 

The "=" sign won't work as Text.Contains takes in two parameters (seperated by a column). Just replace the "=" with a "," and you'll be all good. Good luck!

 

Vijay_A_Verma
Super User
Super User

PQ is super case sensitive.

Following changes are required

1. IF needs to be replaced with if

2. = in Text.Contains needs to be replaced with comma

Hence, in your custom column, you need to input following

 

= if Text.Contains([#"Format commercial regroupé"],"DIGITAL") then "DOOH" else [#"Type d'activité"]

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors