Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi,
I’m new to Power BI and am trying to create a new column in Power Query. To explain I'm trying to write a condition if Quarter = Q1-2022 and Q3_Q3B is not blank then return 1 else return null for all other cases.
My current syntax is:
= if [Quarter]="Q1-2022" and [Q3_Q3B] <> null then 1 else null
Example data
| Quarter | Q3_Q3B | Desired column output | Current incorrect output |
| Q1-2022 | Agree Strongly | 1 | 1 |
| Q1-2022 | Agree | 1 | 1 |
| Q1-2022 | Neither | 1 | 1 |
| Q1-2022 | Disagree | 1 | 1 |
| Q1-2022 | Strongly Disagree | 1 | 1 |
| Q1-2022 | Not sure | 1 | 1 |
| Q1-2022 | null | 1 | |
| Q1-2022 | null | 1 | |
| Q2-2022 | Agree | null | null |
| Q2-2022 | Neither | null | null |
I don’t have a syntax error but I don’t quite get the desired output. The 3rd column is what I want to achieve the 4th column is the current output I get.
I'd appreciate any help
Jazz
Solved! Go to Solution.
Hi,
In the column Q3_Q3B there is no null value. In your formula's if condition use "" instead of null.
Artur
Hi,
In the column Q3_Q3B there is no null value. In your formula's if condition use "" instead of null.
Artur
Thank you.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 5 | |
| 4 | |
| 4 |