Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Static Grouping in-between value

Hi All,

 

I'm having a bit of trouble grasping static grouping in DAX. I have 2 tables

1) Age grouping

From    To       Age group

-10A (0)
12B (1-2)
35C (3-5)
610D (6-10)
1120E (11-20)
2130F (21-30)
3150G (31-50)
51100H (51-100)
101999I (100+)

 

And a 2) Tickets:

COMPANYSTATUSTICKET_IDCREATION_DATETICKET_AGE
ATWorking97024807/06/2021497
ATOpen84825007/09/202240
ATOpen99387019/09/202228
ATOpen70167327/09/202220
ATOpen70069727/09/202220

 

My objetive is to, in table 2) "Tickets" create a new column called "Age group" .

This new column is populated with the text in Age Group of Table 1 "Age grouping" by comparing of the value in TICKET_AGE agaisnt "From" and "to" of Table 1 "Age grouping".

How can I go about doing this?

Your insight is much appreciated!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Age group =
VAR ReferenceAge = 'Table 2'[Age]
RETURN
    SELECTCOLUMNS (
        FILTER (
            'Table 1',
            'Table 1'[From] <= ReferenceAge
                && 'Table 1'[To] >= ReferenceAge
        ),
        "@val", 'Table 1'[Age group]
    )

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

That tottally worked, thanks a lot!

johnt75
Super User
Super User

Try

Age group =
VAR ReferenceAge = 'Table 2'[Age]
RETURN
    SELECTCOLUMNS (
        FILTER (
            'Table 1',
            'Table 1'[From] <= ReferenceAge
                && 'Table 1'[To] >= ReferenceAge
        ),
        "@val", 'Table 1'[Age group]
    )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.