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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
PlastiquesMoore
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

Hi @PlastiquesMoore 

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")

Capture6.JPG

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

Capture7.JPG

 

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."

Please share a detailed example.

 

Best Regards

Maggie

sss

View solution in original post

7 REPLIES 7
edhans
Super User
Super User

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 I answer your question? Mark my post as a solution!
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

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

 

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

 

 
 

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 I answer your question? Mark my post as a solution!
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

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.

Hi @PlastiquesMoore 

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")

Capture6.JPG

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

Capture7.JPG

 

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."

Please share a detailed example.

 

Best Regards

Maggie

sss

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 get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
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
Greg_Deckler
Community Champion
Community Champion

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

 

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

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors