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
Aryaja96
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.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
tackytechtom
Super User
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 🙂 

tomfox_0-1652204602825.png

 

I used the following sample data:

YearAgeBin

202021Between 20-30
202027Between 20-30
202031Between 30-40
202022Between 20-30
202025Between 20-30
202039Between 30-40
202035Between 30-40
202042Between 40-50
202058Between 50-60
202161> 60
202167> 60
202162> 60
202180> 60
202122Between 20-30
202130Between 30-40
202131Between 30-40
202132Between 30-40
202125Between 20-30
202127Between 20-30

 

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

tomfox_1-1652204788907.png

 

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:

tomfox_2-1652204912279.png

 

For both graphs I chose the stocked bar chart   

 

 tomfox_3-1652205008658.png

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
Aryaja96
Frequent Visitor

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

tackytechtom
Super User
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 🙂 

tomfox_0-1652204602825.png

 

I used the following sample data:

YearAgeBin

202021Between 20-30
202027Between 20-30
202031Between 30-40
202022Between 20-30
202025Between 20-30
202039Between 30-40
202035Between 30-40
202042Between 40-50
202058Between 50-60
202161> 60
202167> 60
202162> 60
202180> 60
202122Between 20-30
202130Between 30-40
202131Between 30-40
202132Between 30-40
202125Between 20-30
202127Between 20-30

 

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

tomfox_1-1652204788907.png

 

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:

tomfox_2-1652204912279.png

 

For both graphs I chose the stocked bar chart   

 

 tomfox_3-1652205008658.png

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

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.