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

Display the Age range using Power BI (Standpoint Online)

H All, 

 

I have a SharePoint list with different columns (age, region, balance etc.) for a sample bank and I wanted to display different charts/reports using Power BI.

 

These are the screenshot of the SharePoint List:

 

01 SharePoint List.jpg

I need to display Geographical map, Gender, and Age etc.
I connect to SharePoint list on SharePoint Online via Power BI.

 

 The map visualization works well.

 02 Map.jpg


And gender using Pie chart works well as shown

 

03 Gender PIE.jpg



However, what customer is looking for an age rage as follows:

  1. a) Average Age Years
  2. b) % below 30 years
  3. c) % 31-40 years
  4. d) % 41-50 years
  5. e) % 51-60 years
  6. f) % above 60 years

 

I came up with this:

 



05 Age group.jpg

  

  1. Visualization: Stacked Column Chart
  2. Dragged the Stacked Column Chart
  3. Created Age group
  4. Grouped the “20” and
  5. Clicked OK.

    and the charts shows:

    06 Result.jpg


    How could I leverage age range charts (% below 30 years, % 31-40 years, % 41-50 years etc.) using Power BI?

 

Any help would be highly appreciated.

Thanks!   

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Anonymous,


For your scenario, I think you can add a calculated column to add custom category, then use it to calculate percent of each range.
Calculate column sample:

Age Range =
IF (
    [Age] >= 60,
    "Over 60",
    IF (
        [Age] >= 51
            && [Age] = 60,
        "51 ~60",
        IF (
            [Age] >= 41
                && [Age] <= 50,
            "41 ~50",
            IF ( [Age] >= 31 && [Age] <= 40, "31 ~ 40", "Below 30" )
        )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @Anonymous,


For your scenario, I think you can add a calculated column to add custom category, then use it to calculate percent of each range.
Calculate column sample:

Age Range =
IF (
    [Age] >= 60,
    "Over 60",
    IF (
        [Age] >= 51
            && [Age] = 60,
        "51 ~60",
        IF (
            [Age] >= 41
                && [Age] <= 50,
            "41 ~50",
            IF ( [Age] >= 31 && [Age] <= 40, "31 ~ 40", "Below 30" )
        )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helllo  I am trying to calculte the age and tenure  groups below. Does any one have a good suggestion for cretaing a calculated colum  using a DAX expression for the below. any help would greatly be appreciated. Thanks in advance 

 

Age:

Ranges 

21-25

26-30

31-35

36-40

41-45

46-50

51-60

61-65

66-70

71-75

 

For tenure:

 

6 months -1 year 

2-5 years 

6-10

11-15

16-20

21-25

26-30

31-35

36-40

41-45

46-50

51-55

 

 

thanks! Worked for me. I used this to create a scorecard where a certain range would give a numeric score. 

Anonymous
Not applicable

Thank you so much v-shex @v-shex-msft ..

Your advice is really useful! 

 

Thanks!

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.