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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
PCStrouble
New Member

If one of 2 values is less than 20

I have a software that outputs a value in one or two columns. 

 

I have tried to write my own calculate column but always get an error or all zeros.

 

At any time if value_1 is 20 or above i need the formula to output a 1. 

If there is no value_1 but the value_2 over 20 id also need a 1. 

 

The null values i think are whats causing my errors. 

 

Heres what im hoping for.

Value_1

Value_2

Result

Null

Null

0

15

33

0

20

null

1

5

25

0

Null

20

1

30

2

1

Null

19

0

33

Null

1

23

10

1

null

null

0

5 REPLIES 5
FreemanZ
Super User
Super User

hi @PCStrouble 

Try to create a calculated column like:
Column =
IF(
   OR(
       [value_1]>=20,
       [value_1]=BLANK()&&[value_2]>=20
   ),
   1
)

I think i stated the problem wrong? Im in the "transform Data" section and OR is not being accepted. I am trying to create a custom column to achieve the task

Power query editor

hi @PCStrouble 

the previous code is for calculated column with DAX. 

 

in Power Query, please try

1) replace all null with 0

2) create a custome column like:

= Table.AddColumn(#"Replaced Value1", "Custom", each if
[Value_1]>=20 or ([Value_1]=0 and [Value_2]>=20)
then 1
else 0)

 

it worked like:

FreemanZ_0-1681559464257.png

 

PCStrouble
New Member

I am by no means a software engineer, coder, at all good with this

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.