Forum Discussion
Age Bins
- 1 year ago
As per your condition, Age 0 is <1 as you used <=1 instead of <1. Also, shouldn't it be 6-10 instead of 5-10 as there is already a category that includes 5?
Age Bins = SWITCH ( TRUE (), ISBLANK ( 'Legal Files'[Child Age] ) || 'Legal Files'[Child Age] = 0, "0", 'Legal Files'[Child Age] < 1, "<1", 'Legal Files'[Child Age] <= 5, "1-5", 'Legal Files'[Child Age] <= 10, "6-10", 'Legal Files'[Child Age] > 10, "Older than 10" ) - 1 year ago
Hi inglexjc,
using the filw that v-hjannapu attached, I see this if I turn the graph into a table visual
Age 0 is included and considered and all the children (7 rows) are shown
If you still have issues, the only way to fix it is that you share some of your data so we check if there is any anomaly. Please anyway make sure to check the result as a table visual and only after as a graph
If you have already done this and I missed the thing, apologies, just please send here the link to your data. We need to fix the thing on your semantic model in my opinion
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
The data has PPI so I can't paste the acutal table. This is the formula that I'm using for the Age Bins.
Hi inglexjc
Can you try this?
Age Bins =
SWITCH(
TRUE(),
'Legal Files'[Child Age] = BLANK(), "0",
'Legal Files'[Child Age] < 1, "<1",
'Legal Files'[Child Age] <= 5, "1-5",
'Legal Files'[Child Age] <= 10, "6-10",
'Legal Files'[Child Age] > 10, "Older than 10"
)
I changed the comparison for "<1" and the text from "5-10" to "6-10".
- inglexjc1 year agoPost Patron
Same issue as the others. Age 0 is still missing. I'm trying to fiqure out how to provide a version of the report with out giving PPI.
In the data I have the Child DOB but not age. So I used a formula to determine the child's age.
Child Age = DATEDIFF([Child DOB],TODAY(),YEAR)There are adults in the report and their DOB is blank, so that causes blanks in Child Age.Not sure if that is part of the problem?
- EHISAdmin1 year agoFrequent Visitor
I had a similar issue and used a calculated column to establish the child age
Age at Case Assignment = DATEDIFF(RELATED(Child[DOB]),Assessment[Record Created], MONTH)and then used the following to set the bins:
Age at Case Assignment Group = SWITCH(Assessment[Age at Case Assignment],1, "0 to 6 Months",2, "0 to 6 Months",3, "0 to 6 Months",4, "0 to 6 Months",5, "0 to 6 Months",6, "0 to 6 Months",7, "7 to 12 Months",8, "7 to 12 Months",9, "7 to 12 Months",10, "7 to 12 Months",11, "7 to 12 Months",12, "7 to 12 Months",13, "A Year to 18 Months",14, "A Year to 18 Months",15, "A Year to 18 Months",16, "A Year to 18 Months",17, "A Year to 18 Months",18, "A Year to 18 Months",19, "Between 19 and 24 Months",20, "Between 19 and 24 Months",21, "Between 19 and 24 Months",22, "Between 19 and 24 Months",23, "Between 19 and 24 Months",24, "Between 19 and 24 Months",25, "Between 25 and 36 Months",26, "Between 25 and 36 Months",27, "Between 25 and 36 Months",28, "Between 25 and 36 Months",29, "Between 25 and 36 Months",30, "Between 25 and 36 Months",31, "Between 25 and 36 Months",32, "Between 25 and 36 Months",33, "Between 25 and 36 Months",34, "Between 25 and 36 Months",35, "Between 25 and 36 Months",36, "Between 3 and 4 Years",37, "Between 3 and 4 Years",38, "Between 3 and 4 Years",39, "Between 3 and 4 Years",40, "Between 3 and 4 Years",41, "Between 3 and 4 Years",42, "Between 3 and 4 Years",43, "Between 3 and 4 Years",44, "Between 3 and 4 Years",45, "Between 3 and 4 Years",46, "Between 3 and 4 Years",47, "Between 3 and 4 Years",48, "Between 3 and 4 Years",49, "Between 4 and 5 Years",50, "Between 4 and 5 Years",51, "Between 4 and 5 Years",52, "Between 4 and 5 Years",53, "Between 4 and 5 Years",54, "Between 4 and 5 Years",55, "Between 4 and 5 Years",56, "Between 4 and 5 Years",57, "Between 4 and 5 Years",58, "Between 4 and 5 Years",59, "Between 4 and 5 Years",60, "Between 4 and 5 Years","Over 5 Years")