Add a new calculated column

I have a table with citizen information, including the citizen's age. I would like to create a new calculated column called [Age Distribution] that categorizes the citizen's age into fixed ranges. So far, I have created the age distribution in Power Query as follows:

if [Age] >= 45 and [Age] < 63 then "45-62" else if [Age] >= 63 and [Age] < 75 then "63-74" else if [Age] >= 75 and [Age] < 87 then "75-86" else if [Age] >= 87 and [Age] <= 98 then "87-98" else if [Age] >= 99 then "99+" else "Unknown"

Is it possible in TARGIT?

 

Best regards

Per-Bo Pirschler

0

Comments

1 comment
  • Hi Per-Bo

    Yes absolutely - I think there is more than one way.

    I'm assuming you're using data discovery since your post in placed in this forum:

    In Data Discovery there is a concept called formats, where you can add a column and create the groupings as you describe them with an if sentence. 

    In Data Discovery we utilize an excel library of functions that can be used in connection with formats as mentioned.

    You could also choose to fix this in TARGIT while building your analysis. Still assuming that you are using Data Discovery, your age column will be offered to you by default as both a dimension and a measure.

    With the dimension age, you can simply build a user dimension to do your grouping.

    Hope it makes sense.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post