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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
wherdzik
Helper III
Helper III

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

wherdzik_0-1698097309534.png

wherdzik_1-1698097343082.png

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?

 

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @wherdzik 
Please share your table to work with.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.