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
Sushant_Uniphor
Regular Visitor

Customised Bins for Age Field

Hi All,

 

I would need a help to know how i can make bins as per my choice in power bi.

 

So I have [Age] field, and it has values from diff age groups varies from 15 yrs to 70 yrs.

 

I want to see which age group is using my product more or have most no of footfall in my app.

 

this code is not working for me

 

Bins_NewUser = var temp= COUNT('Tableau_vw_TotalUsers'[Age]) return
if(temp <=10,"less than 10",if(AND(temp>10,temp<=20),"more than 10 and less than 20",if(AND(temp>30,temp<=50),"more than 30 and less than 50","more than 50")))

 

Below is a demo of that...


Age bins.PNG

 

 

 

 

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
richbenmintz
Solution Sage
Solution Sage

Hi @Sushant_Uniphor ,

 

Are you trying to create a column to use on the X axis? based on the age in the Tableau_vw_TotalUsers table?

If so you can create a calc column like the following:

 

User Bin = 
switch(true(),
'Tableau_vw_TotalUsers'[Age] <=10, "less than 10",
'Tableau_vw_TotalUsers'[Age] <=20, "between 10 and 20",
....,
"greater_than_n"
)

 

Hope that Helps



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

Anonymous
Not applicable

You can achieve it by creating a conditional column for the ranges and then using that field on the chart. 

Go to Power Query > Add Column > Conditional Column and type the following conditions:

Raymundo2910_0-1623851025000.pngRaymundo2910_1-1623851158868.png

I used a random sample from Excel. Find my work files on the following Drive folder.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Sushant_Uniphor,

Did these suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements to find it more quickly.

If these also not help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

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

You can achieve it by creating a conditional column for the ranges and then using that field on the chart. 

Go to Power Query > Add Column > Conditional Column and type the following conditions:

Raymundo2910_0-1623851025000.pngRaymundo2910_1-1623851158868.png

I used a random sample from Excel. Find my work files on the following Drive folder.

richbenmintz
Solution Sage
Solution Sage

Hi @Sushant_Uniphor ,

 

Are you trying to create a column to use on the X axis? based on the age in the Tableau_vw_TotalUsers table?

If so you can create a calc column like the following:

 

User Bin = 
switch(true(),
'Tableau_vw_TotalUsers'[Age] <=10, "less than 10",
'Tableau_vw_TotalUsers'[Age] <=20, "between 10 and 20",
....,
"greater_than_n"
)

 

Hope that Helps



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


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.