I am trying to filter a set of data to group them by a metric (for me it’s not a timestamp, but a distance).
I would like to define the start/end using a measure. I could pre-filter it when importing the data, but the report is dynamic and the partition by items changed based on the selection of the user.
So far, I just did this:
start = calculate min([metric], REMOVEFILTERS(Categories[Categories]))
and
end = calculate max([metric], REMOVEFILTERS(Categories[Categories]))
This does not give the right answer. It mixes the groups, and do not take into account the gaps.
In my case, Categories[Categories] is what the user select to display.
When I display on a table, the start, end, and the rest, this is what I get:
But normally, the interval should be:
- 0 -> 114
- 114 -> 13820
- 13820 -> 21900
- 21900 -> 53712
- 53712 -> 54000
Any hint of how can I achieve what I want ?