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! Request 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
Super User
Super User

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
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.