Forum Discussion

wherdzik's avatar
wherdzik
Helper III
2 years ago

Age Grouping Help

I have this chart that I made that creates grouping with the help of ChatGPT.  But I realized that I was missing data, some of the data has blank date of brith because the babies have not been born yet.  I would like to create a condition that if there is blank then put it in the category "Preterm". 

Chat GPT is telling me to use this but I cannot get it to work:

= Table.AddColumn(#"Total Years", "Custom", each if Table.IsEmpty([Age]) or [Age] = null then "Preterm" else if [Age] <= 0.0833 then "Newborn (0 to 1 Month)" else if [Age] <= 1 then "Infant (1 to 12 Months)" else if [Age] <= 3 then "Toddler (1 to 3 Years)" else if [Age] <= 6 then "Preschool (3 to 6 Years)" else if [Age] <= 12 then "School Age (6 to 12 Years)" else "Adolescents (12+ Years)" )

 

Can someone help me through this one please?