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
Anonymous
Not applicable

Custom column - 2 columns condition

Hello,

 

Im trying to add a custom column that taked 2 conditions from 2 different colums in the same table.

I tried using IF function but it returns this error "Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly."

This is what i tried - 

 

IF([Event]="X" & [EventName]="Y",0,1)

The reason is to be able to sum up the colum with edit query.

 

Thanks!

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

if is lower case in Power Query. 

What you need is 

 

 

if [Event] = "X" and [Eventname] = "Y" then 0 else 1

 

 

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try &&

IF([Event]="X" && [EventName]="Y",0,1)

PhilipTreacy
Super User
Super User

Hi @Anonymous 

if is lower case in Power Query. 

What you need is 

 

 

if [Event] = "X" and [Eventname] = "Y" then 0 else 1

 

 

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi!

Thanks a lot, that did the trick.

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.