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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sd_kevin
Advocate II
Advocate II

How to filter records only where four columns don't contain null or zero

Hi,

 

I am trying to only show records which contain data in the four columns with amounts (<> null and <> 0). I tried:

 

Table.SelectRows(#"Filtered Rows2", each
    [Amortization] <> null  and [Amortization] <> 0 and [BookCost] <> null and [BookCost] <> 0 and
    [Depreciation] <> null and [Depreciation] <> 0 and [AllocatedExpense] <> null [AllocatedExpense] <>0
)

 

but it did not return any records. It works with I only apply that filter to one column but not when I am evaluating four. It seems like a straight forward thing to do and I can't find anything on the forum or google.

 

From the screenshot, I am trying to exclude rows 5-8.

Need to exclude rows 5-8 onlyNeed to exclude rows 5-8 only

 

 

Thank you for your help!

1 ACCEPTED SOLUTION

@sd_kevin , Try like

 

not( ([Amortization] = null or [Amortization] = 0) and ([BookCost] = null or [BookCost] =0) and
([Depreciation] = null or[Depreciation] = 0) and ([AllocatedExpense] = null or [AllocatedExpense] =0) )

View solution in original post

6 REPLIES 6
Dhacd
Resolver III
Resolver III

Hi @sd_kevin 

Try the below code.

 ([Amortization] <> null  or [Amortization] <> 0) and ([BookCost] <> null or[BookCost] <> 0) and
    ([Depreciation] <> null or[Depreciation] <> 0) and ([AllocatedExpense] <> null or [AllocatedExpense] <>0)

 

If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.

Regards,

Atma.

Unfortunately that did not remove any records.

@sd_kevin , Can you check whether the  [Amortization] field is totally blank then the code above will not provide you with a solution.

If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.

when you say totally blank are you saying blank verus null? The [Amortization] field has either amounts or null; there are not blank values.

 

Thank you

@sd_kevin , Try like

 

not( ([Amortization] = null or [Amortization] = 0) and ([BookCost] = null or [BookCost] =0) and
([Depreciation] = null or[Depreciation] = 0) and ([AllocatedExpense] = null or [AllocatedExpense] =0) )

Thank you so much! That worked!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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