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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors