Forum Discussion
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!
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."
Please share a detailed example.
Best Regards
Maggie
sss
7 Replies
- edhansCommunity Champion
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.
- PlastiquesMooreRegular Visitor
I did this and I'm getting an error message.
= if ([#"External PPM - Medical Planifié"] = [#"External PPM - Medical Actuel"] then "Match" else "No match")
- edhansCommunity Champion
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.
- Greg_DecklerCommunity 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