This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I am trying to write an IF statement in the edit query but am having no luck. Is this function available?
Solved! Go to Solution.
Neither link mentions what happens if you use and's and or's without parentheses, so here is a little teaser for you:
= if 1 < 2 and 1 < 2 or 1 > 2 and 1 > 2 then """or"" starts a new group" else """and"" starts a new group"
HI @beccar_13,
Perhaps you can take a look at following links to know more about if statement:
The IF Function In Power Query
Regards,
Xiaoxin Sheng
Neither link mentions what happens if you use and's and or's without parentheses, so here is a little teaser for you:
= if 1 < 2 and 1 < 2 or 1 > 2 and 1 > 2 then """or"" starts a new group" else """and"" starts a new group"
These threads should be able to give you your answer:
https://community.powerbi.com/t5/Desktop/IF-Statement-Custom-Column/m-p/125631/highlight/true#M53204
Most definitely, in the Query Editor, you can do things like:
if ( [AMT] = 0 or [AMT] = null ) and [Units] = 0 then 0
else 1
or
if [Code] <> null and [Description] <> null then [Code]&": "&[Description]
else if [Code] <> null then [Code]
Hope this helps,
Thank you so much for your help! I really appreciate it!
And bear in mind that Power Query is case sensitive with all keywords in lowercase, so IF won't work,
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 25 | |
| 24 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 48 | |
| 27 | |
| 23 | |
| 20 |