Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to 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)
Use this
(Number.From([EUROPE]>0) + Number.From([NORTH AMERICA]>0) + Number.From([ASIA PAC]>0))>1
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
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.