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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply

Need help with Custom Column

Hi,
I need your help with the custom column formula for the below table. I am looking to create a table with a condition that at least any of two columns should have non zero values out of three region columns.
Thank you in advance sadjskdjkasdsa.png

1 ACCEPTED SOLUTION

In the screenshort which you have shown only Europe column has non zero value. So for the records shown you will get FALSE. May be the qualifying records may be much down below which are not within PQ limit of 1000 records for preview.

You apply the filter to TRUE and load the records. Then those records will be visible to you. If you are interested in another construct, then below is another formula. 

([EUROPE]>0 and [NORTH AMERICA]>0) or ([NORTH AMERICA]>0 and [ASIA PAC]>0) or ([EUROPE]>0 and [ASIA PAC]>0)

View solution in original post

7 REPLIES 7
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Use this

(Number.From([EUROPE]>0) + Number.From([NORTH AMERICA]>0) + Number.From([ASIA PAC]>0))>1

dsfsfdsfdfd.pngHi @Vijay_A_Verma 

Thanks for the reply. The result is all "Flase". I am sure there are records in the data which should have been "True".
Your thoughts?

Copy this code in a fresh query and you will see that it works correctly.

Why it is not working for you - I would need to look at a sample file provided by you which you can upload to Onedrive/Google drive etc and share the link here

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlDSAWNDpVidaCAJ4RmbgLkQCZAQjGcGV2oBlTOCy0FwbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EUROPE = _t, #"NORTH AMERICA" = _t, #"ASIA PAC" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"EUROPE", Int64.Type}, {"NORTH AMERICA", Int64.Type}, {"ASIA PAC", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each (Number.From([EUROPE]>0) + Number.From([NORTH AMERICA]>0) + Number.From([ASIA PAC]>0))>1)
in
    #"Added Custom"

 

This is how the data looks like

virendrajadhav1_0-1689334393519.png

 

In the screenshort which you have shown only Europe column has non zero value. So for the records shown you will get FALSE. May be the qualifying records may be much down below which are not within PQ limit of 1000 records for preview.

You apply the filter to TRUE and load the records. Then those records will be visible to you. If you are interested in another construct, then below is another formula. 

([EUROPE]>0 and [NORTH AMERICA]>0) or ([NORTH AMERICA]>0 and [ASIA PAC]>0) or ([EUROPE]>0 and [ASIA PAC]>0)

This worked. Thanks much !!

@Vijay_A_Verma 
Thanks for the prompt respose. Sadly, I may not able to share further details of an actual data due to the policies of the client I work with. The consequences could be as worse as termination of my employment. I hope you understand that. 
The above code works but not in a manner I was hoping it would. Very few records are returned which cannot be true. I crossed check some in using case statements in SQL and the records are way more than what I am getting here.
If I may ask, is there any combination simple nested "IF" and "AND" statement which I could use. The only result I need is two values in the custom column. 
Again, I truly appreciate your help.  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.