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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Grouping

Hey

 

I have a column called Age. I want to seperate it as groups like

 

Age 55+

Age 45-55

Age 35-45

 

How can this be done?

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi - Create a calculated column such as

Age Group = SWITCH(True(), [Column Name] <=45, "35-45",
[Column Name] <=55,"45-55","+55")

This is assuming that there are no ages below 35 in have data.

D

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous

 

The above solution by @davehus will work for you.

 

Just for your information - You can right click your age column and select "New Group" and then you can create grouping there. This is best suitable if you want to group some category, as in your case there is no gurantee that you will have all ages in your data.

 

Thanks

Raj

Anonymous
Not applicable

Thank You. But I want the legend to be shown as '45-55', '35-45' etc. Doing Groups just shows Age(bins) as 30, 35 etc given the size of the bin chosen. IS there any other way

The Switch function I provided you with will work.
Anonymous
Not applicable

Thank You!

 

davehus
Memorable Member
Memorable Member

Hi - Create a calculated column such as

Age Group = SWITCH(True(), [Column Name] <=45, "35-45",
[Column Name] <=55,"45-55","+55")

This is assuming that there are no ages below 35 in have data.

D
Anonymous
Not applicable

Thank You! Bur what comes under column name? The variable Age comes under a table called Students. So would the column name be Student[AGE]?

Hi... Yes it would be the age.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.