Forum Discussion
Anonymous
3 years agoNot 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 -1 0 A (0) 1 2 B (1-2) 3 5 C (3-5) 6 10 D (6...
- 3 years ago
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] )
johnt75
Super User
3 years agoTry
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]
)