cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Help Creating Custom Age Bins

Hey there,

 

I have a dataset that looks at tasks created and completed over time, and have created a chart to show issues created by month.

Lowea_0-1594176695319.png

However, instead, I want to change this to a histogram and group into different age bins of "Created in the last month", "created 2 months ago" ... "created 5 months ago" and "created 6+ months ago" I have created a column called Age which takes (today's date - created date) to give the age in days. I now just need to somehow create these bins as the inbuilt bin creation functionality will not allow me to do this.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Help Creating Custom Age Bins

@Lowea , In your date table that joined with the created date you can have a column like this

Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Created Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
eomonth([Date],0) >= eomonth(Today(),-2),"Created 2 Month3 ago" ,
eomonth([Date],0) >= eomonth(Today(),-3),"Created 3 Month3 ago" ,
eomonth([Date],0) >= eomonth(Today(),-4),"Created 3 Month4 ago" , 
/// keep on adding
Format([Date],"MMM-YYYY")
)

 

Or refer

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Community Champion
Community Champion

Re: Help Creating Custom Age Bins

Hi @Lowea ,

 

You can try this 

 

https://community.powerbi.com/t5/Desktop/Display-the-Age-range-using-Power-BI-Standpoint-Online/m-p/...

 

https://community.powerbi.com/t5/Desktop/Grouping-by-age/td-p/208263

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

Highlighted
Super User IV
Super User IV

Re: Help Creating Custom Age Bins

@Lowea , In your date table that joined with the created date you can have a column like this

Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Created Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
eomonth([Date],0) >= eomonth(Today(),-2),"Created 2 Month3 ago" ,
eomonth([Date],0) >= eomonth(Today(),-3),"Created 3 Month3 ago" ,
eomonth([Date],0) >= eomonth(Today(),-4),"Created 3 Month4 ago" , 
/// keep on adding
Format([Date],"MMM-YYYY")
)

 

Or refer

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors