Forum Discussion
Creating Range for Age Groups
I need to create a graph to show age groups, and have them color coded based on age and date they have court.
My table that has data has PPI so I can't share it. But the table name is called "Legal Files" and I have Child DOB and Age as columns (in addition to Court Date and other information not needed for this graph).
Please advise how to group these ages and then how to color code these age groups.
hi inglexjc ,
create a table as follows:
table code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBONlTSUQJhAxDWs4QDpVidaCVDXVOgsBFUiQm6tKmuIUibMRCD1FliaDfQBmkDaTcAEwigFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Band = _t, Order = _t, Min = _t, Max = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Band", type text}, {"Order", Int64.Type}, {"Min", Int64.Type}, {"Max", type number}})
in
#"Changed Type"______
create a measure:
Count Age = VAR __AgeBandMin = SELECTEDVALUE('Table'[Min] ) VAR __AgeBandMax = SELECTEDVALUE('Table'[Max] ) return CALCULATE( COUNT(Table2[Age]), Legal Files[Age] >= __AgeBandMin, Legal Files[Age] <= __AgeBandMax )Appreciate a thumbs up if this helped.
Please accept this as the solution if your query is resolved.
10 Replies
- adudaniMemorable Member
hi inglexjc ,
create a table as follows:
table code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBONlTSUQJhAxDWs4QDpVidaCVDXVOgsBFUiQm6tKmuIUibMRCD1FliaDfQBmkDaTcAEwigFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Band = _t, Order = _t, Min = _t, Max = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Band", type text}, {"Order", Int64.Type}, {"Min", Int64.Type}, {"Max", type number}})
in
#"Changed Type"______
create a measure:
Count Age = VAR __AgeBandMin = SELECTEDVALUE('Table'[Min] ) VAR __AgeBandMax = SELECTEDVALUE('Table'[Max] ) return CALCULATE( COUNT(Table2[Age]), Legal Files[Age] >= __AgeBandMin, Legal Files[Age] <= __AgeBandMax )Appreciate a thumbs up if this helped.
Please accept this as the solution if your query is resolved.
- Emily_RobertNew Member
Creating clear age ranges really helps bring structure and fairness to any system that categorizes people or data. When ranges are thoughtfully defined, it becomes much easier to analyze trends, compare outcomes, and ensure consistency across different scenarios. I’ve seen similar principles applied effectively in record organization, especially when reviewing Durham Court Cases alongside demographic details. Overall, a well-planned range framework makes information more accessible and decision-making more reliable.
- Joe_KaneNew Member
I really appreciate how this post highlights the importance of setting clear ranges for age groups, as it improves clarity and consistency in planning and analysis. A similar structured approach is useful when reviewing public information, and I’ve seen this work well with Seminole County Cases because details are organized in an easy-to-follow way. Overall, thoughtful grouping helps people understand data faster and make better decisions.