cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## IF formula

Hi everyone,

Hope everlone is doing well with this Covid-19 crap!

I have an Excel formula that I would like to use in Power BI.

=IF(A2=B2;"Match";"No Match")

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

## Re: IF formula

For the 'IF' column, if you create a measure or a calculated column, use formulas below:

``````Measure = IF(MAX([Column1])=MAX([Column2]),"match","no match")

Column = IF([Column1]=[Column2],"match","no match")``````

if you open Edit queries, then add a custom column, you can do this way,

As for the requirement,

"What I want to do is that when the value "0" has been found twice in the same row, I want a message to appear."

Best Regards

Maggie

sss

7 REPLIES 7
Highlighted
Super User IX

## Re: IF formula

Well, if it is a column, then you could use:

Column =IF([A Column]=[B Column];"Match";"No Match")

---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Super User!

Highlighted
Super User VI

## Re: IF formula

In Power Query, it would be in a custom column:

``= if [Column A] = [Column B] then "Match" else "No Match"``

Note PQ is case sensitive.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Highlighted
Regular Visitor

## Re: IF formula

I did this and I'm getting an error message.

= if ([#"External PPM - Medical Planifié"] = [#"External PPM - Medical Actuel"] then "Match" else "No match")

Highlighted
Super User VI

## Re: IF formula

Generally it should be columns. #"Someting here" refers either to an external query or a different step. If you are referring to a step, get rid of the brackets. Columns are [Columns] and steps are either Steps or #"A Step" if there is a space in it.

Unless you really know what you are doing, you should start out only using column references. [Column A] + [Column B] for example. Don't try to get advanced by referring to outside queries or other steps as your first if/then/else construct.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Highlighted
Regular Visitor

## Re: IF formula

Hi,

I'm still a beginner and learning! 🙂

I just tried this and it's still not working.

= if [External PPM - Medical Planifié] = [External PPM - Medical Actuel] then "Match" else "No match")

What I want to do is that when the value "0" has been found twice in the same row, I want a message to appear.

Highlighted
Super User VI

## Re: IF formula

Please post sample data, or your PBIX file. I cannot tell if your syntax is wrong or if something else is going on because I don't know your column headings. See links below, then give me what your expected output is:

How to provide sample data in the Power BI Forum

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Highlighted
Community Support

## Re: IF formula

For the 'IF' column, if you create a measure or a calculated column, use formulas below:

``````Measure = IF(MAX([Column1])=MAX([Column2]),"match","no match")

Column = IF([Column1]=[Column2],"match","no match")``````

if you open Edit queries, then add a custom column, you can do this way,

As for the requirement,

"What I want to do is that when the value "0" has been found twice in the same row, I want a message to appear."

Best Regards

Maggie

sss

Announcements

#### August Community Highlights

Check out a full recap of the month!

#### August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

#### 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
Top Kudoed Authors