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.
I need to create a column that populates eby calculating the value of cells within a certain range with those that are not null as +1 and ones that are empty/null as 0. In other words, if cells A1-A10 contained some kind of text, then the corresponding cell in the new column would equal 10. If cells A1-A8 were not blank the corresponding value would be 8. If none contained text of any kind the value would equal zero and so on.
I realize the easiest way to get around this would probably just be to make a calculated column in excel and then add it that way but I'm also trying to understand the M syntax in this scenario for future reference as well.
Thanks in advance for any suggestions!
List.Count(List.Select(List.Transform(List.Range(Record.FieldNames(_), 1, 5), (name) => Record.Field(_, name)), each _ <> null))
where 1, 5 is the 0 based start and end index of your columns
Hello @Anonymous
could you please post a example and the desired output?
Jimmy
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.