The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Solved! Go to Solution.
@Anonymous
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>>)))
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!
@Anonymous
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>>)))
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 🙂
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 🙂
User | Count |
---|---|
78 | |
73 | |
38 | |
30 | |
28 |
User | Count |
---|---|
107 | |
100 | |
55 | |
49 | |
45 |