Forum Discussion

sokatenaj's avatar
sokatenaj
Advocate II
9 years ago
Solved

Need Help Creating a Calculated Column Based on Birth Year

Good afternoon,   I am struggling here. I tried creating a conditional column or calculated column based on birth year but there is no "BETWEEN" function. I want to say, if Birth Year is between 19...
  • Anonymous's avatar
    Anonymous
    9 years ago

     

    Generation = SWITCH(
        TRUE(),
        TableName[Birth Year] >= 1927 && TableName[Birth Year] <= 1945, "Mature/Silents",
        TableName[Birth Year] >= 1946 && TableName[Birth Year] <= 1964, "Baby Boomer",
        TableName[Birth Year] >= 1965 && TableName[Birth Year] <= 1980, "Gen X",
        TableName[Birth Year] >= 1981 && TableName[Birth Year] <= 1200, "Millenial",
        TableName[Birth Year] >= 2001, "Gen Z/Boomlet",
        BLANK()
    )

     

    Anything before 1927 will remain blank with this formula.

     

    Edit: aww, Vvelarde beat me to it while I was testing something with the new table constructor.