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

How to get breakdown of Customers (who have not ordered) by age range?

Hi all,

 

For example, I have a list of customers who have not placed an order and their birthdate.

 

Table1_Potential Customers

CustID     D.O.B. 

101          1975-01-01

102          1980-08-26

103          1982-08-15

 

How do I create a measure and/or visual that shows the breakdown of age ranges e.g. 21 - 30 years old, 31 - 40 years old, etc. of these customers?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

@v-diye-msft 

 

Thank you for pointing me in the right direction!

 

I have tried the measure and found that changing the "&&" to "," works for me:

Age Group:= IF(AND(Table[Age]>=20, Table[Age]<=30),"21-30", IF(AND(Table[Age]>=30, Table[Age]<=40),"31-40",IF(AND(Table[Age]>=30, Table[Age]<=40),"41-50",<<ELSE CONDITION CONTINUES>>)))

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

I would suggest the solution same as Mvignesh53 ,  please kindly marked his answer as solution if it meets your requirement, or provide more details about your question if you'd like to get another suggestion.  thanks!

 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

@Anonymous 

@v-diye-msft 

 

Thank you for pointing me in the right direction!

 

I have tried the measure and found that changing the "&&" to "," works for me:

Age Group:= IF(AND(Table[Age]>=20, Table[Age]<=30),"21-30", IF(AND(Table[Age]>=30, Table[Age]<=40),"31-40",IF(AND(Table[Age]>=30, Table[Age]<=40),"41-50",<<ELSE CONDITION CONTINUES>>)))
Anonymous
Not applicable

Hi,

 

Sure thing @Anonymous.

 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

 

Anonymous
Not applicable

Hi,

 

You would first have to Create a Measure which calculates their Ages. You need to Create this as a new Column in the Table.

Age:= DATEDIFF(DATE(YEAR(DOB),MONTH(DOB),DAY(DOB)),TODAY(),YEAR)

Once you have the new column named Age. You would need to Create another column to BIN this.

Age Group:= IF(AND(Table[Age]>=20 &&Table[Age]<=30),"21-30", IF(AND(Table[Age]>=30 &&Table[Age]<=40),"31-40",IF(AND(Table[Age]>=30 &&Table[Age]<=40),"41-50",<<ELSE CONDITION CONTINUES>>)))

Once you have both these columns, You need to bring in a Bar Visual into the Canvas and change the Calculation to Count under Values FIELD.

 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂 

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.