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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JRana
New Member

Custom Column

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

QuarterQ3_Q3BDesired column outputCurrent incorrect output
Q1-2022Agree Strongly11
Q1-2022Agree11
Q1-2022Neither11
Q1-2022Disagree11
Q1-2022Strongly Disagree11
Q1-2022Not sure11
Q1-2022 null1
Q1-2022 null1
Q2-2022Agreenullnull
Q2-2022Neithernullnull

 

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

1 ACCEPTED SOLUTION
artpil
Resolver II
Resolver II

Hi,

In the column Q3_Q3B there is no null value. In your formula's if condition use "" instead of null.

Artur

View solution in original post

2 REPLIES 2
artpil
Resolver II
Resolver II

Hi,

In the column Q3_Q3B there is no null value. In your formula's if condition use "" instead of null.

Artur

Thank you.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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