cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## Numerical Ranges

I have a practice dataset which has two tables. one for 2020 and one for 2021, they are just practice survey data for remote work. i am trying to create a visualization where i can show the number of people by an age range like no of people in 20-30,then  30-40 and so on. i have grouped the column and created bins but i am clueless about what i should do next. i was trying to replicate this kind of visualization.

this is from someone else's report but i was practicing and wanted to see if i could create this as well.

can anyone suggest something?

1 ACCEPTED SOLUTION
Super User

Hi @Aryaja96 ,

It depends on your data and the model you are using, but if were you heading for something like this, I can show you how I did it 🙂

I used the following sample data:

YearAgeBin

 2020 21 Between 20-30 2020 27 Between 20-30 2020 31 Between 30-40 2020 22 Between 20-30 2020 25 Between 20-30 2020 39 Between 30-40 2020 35 Between 30-40 2020 42 Between 40-50 2020 58 Between 50-60 2021 61 > 60 2021 67 > 60 2021 62 > 60 2021 80 > 60 2021 22 Between 20-30 2021 30 Between 30-40 2021 31 Between 30-40 2021 32 Between 30-40 2021 25 Between 20-30 2021 27 Between 20-30

And then what I did was the following for the left graph:

And for the right graph, I created a separate measure called PercentageMeasure with the following DAX:

```PercentageMeasure =
VAR _overallCountPerYear = CALCULATE ( COUNTROWS ( Table ), ALLEXCEPT (Table, Table[Year] ) )
RETURN
DIVIDE ( COUNTROWS ( Table ), _overallCountPerYear )```

The graph had the following settings:

For both graphs I chose the stocked bar chart

Let me know if this helps 🙂

 Also happily accepting Kudos 🙂

 Feel free to connect with me on LinkedIn!

 #proudtobeasuperuser

2 REPLIES 2
Frequent Visitor

thank you for the reply, i am going to try it out and let you know if it helps! 🙂

Super User

Hi @Aryaja96 ,

It depends on your data and the model you are using, but if were you heading for something like this, I can show you how I did it 🙂

I used the following sample data:

YearAgeBin

 2020 21 Between 20-30 2020 27 Between 20-30 2020 31 Between 30-40 2020 22 Between 20-30 2020 25 Between 20-30 2020 39 Between 30-40 2020 35 Between 30-40 2020 42 Between 40-50 2020 58 Between 50-60 2021 61 > 60 2021 67 > 60 2021 62 > 60 2021 80 > 60 2021 22 Between 20-30 2021 30 Between 30-40 2021 31 Between 30-40 2021 32 Between 30-40 2021 25 Between 20-30 2021 27 Between 20-30

And then what I did was the following for the left graph:

And for the right graph, I created a separate measure called PercentageMeasure with the following DAX:

```PercentageMeasure =
VAR _overallCountPerYear = CALCULATE ( COUNTROWS ( Table ), ALLEXCEPT (Table, Table[Year] ) )
RETURN
DIVIDE ( COUNTROWS ( Table ), _overallCountPerYear )```

The graph had the following settings:

For both graphs I chose the stocked bar chart

Let me know if this helps 🙂

 Also happily accepting Kudos 🙂

 Feel free to connect with me on LinkedIn!

 #proudtobeasuperuser

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors