Forum Discussion
JCG99
2 years agoRegular Visitor
Grouping with gaps
Hello, I am trying to group data with gaps inside them. This is a sample of my data: distance from distance to built year Type road Living area Zone State 0 10 1990 Alley Ye...
- Anonymous2 years ago
Hi JCG99
Please try the following DAX:Min from = VAR _selectyear = SELECTEDVALUE('Table'[built year ]) VAR _selecttype = SELECTEDVALUE('Table'[Type road ]) RETURN MINX(FILTER(ALL('Table'),'Table'[built year ] = _selectyear && 'Table'[Type road ]=_selecttype),'Table'[distance from])Max to = VAR _selectyear = SELECTEDVALUE('Table'[built year ]) VAR _selecttype = SELECTEDVALUE('Table'[Type road ]) RETURN MAXX(FILTER(ALL('Table'),'Table'[built year ] = _selectyear && 'Table'[Type road ]=_selecttype),'Table'[distance to ])Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JCG99
2 years agoRegular Visitor
Thanks for the answer. The grouping works good when the column buitl year and type road are selected, but not in other configuration.
For instance, when only built year is selected, I get this result:
However, I expect to get all type of road:
0 -> 25 Alley
30 -> 60 Street
60 -> 120 /
300 -> 400 Highway