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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kitkat23
Regular Visitor

IF

Hi,

I have the below if that is flagging any cells that have a number < 60 in a column, but there are also blanks in that column that i want exxcluding, how do I do it:

 

Flag_1HrWait = IF(ED[Time to  seen (minutes)] < 60, 1, 0)
 
Any help appreciated
1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

If blank input values shall result in blank output value:

Flag_1HrWait = IF(NOT(ISBLANK(ED[Time to seen (minutes)])), IF(ED[Time to seen (minutes)] < 60, 1, 0))

If blank input values shall result in 0 output value:

Flag_1HrWait = IF(AND(ED[Time to seen (minutes)] < 60, NOT(ISBLANK(ED[Time to seen (minutes)]))), 1, 0)

View solution in original post

7 REPLIES 7
kitkat23
Regular Visitor

thank you very much.  What i am finding is the measure is not showing the field 'ED[Time to seen (minutes)'

in the selection and i dont know why because it is a number field?  what am I not seeing??

sorry i accepted the solution and not sure if that closed this call

This code only works for a calculated column, not for a measure. Maybe you have chosen new measure instead of new column? If unsere, you could share your file.

The field '[Time to seen (minutes)' is a field built with a SQL table it is not anything I am calcuating in power bi.  It contains numbers and blanks

 
sorry ignore the above using the below it now has error:
Flag_1HrWait = IF(NOT(ISBLANK(ED[Time to seen (minutes)])), IF(ED[Time to seen (minutes)] < 60, 1, 0))
'The expression refers to multiple columns. Multiple columns can not be converted to scalar value'
what does that mean.  The field does appear in another table but I am saying what table to look at in the formula?
 
kitkat23_0-1687520036971.png

 

 

Can you provide the file including the code that produces the error, pls.?

Martin_D
Super User
Super User

If blank input values shall result in blank output value:

Flag_1HrWait = IF(NOT(ISBLANK(ED[Time to seen (minutes)])), IF(ED[Time to seen (minutes)] < 60, 1, 0))

If blank input values shall result in 0 output value:

Flag_1HrWait = IF(AND(ED[Time to seen (minutes)] < 60, NOT(ISBLANK(ED[Time to seen (minutes)]))), 1, 0)

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.