Forum Discussion
Number ranges filter out singels
- 8 years ago
Hi Baconbomb,
I think this case has to be solved using either M and DAX, I tried to follow:
M ->
Add an index to this table;
DAX ->
I've created a calculated column to get the previous TO column value:
PREVIOUS_TO = SELECTCOLUMNS(FILTER(Table1; Table1[Index] = EARLIER(Table1[Index]) - 1); "To"; Table1[To])
After that a measure calculating the gap between the previous TO with the current FROM:
_GAP = IF(SUM(Table1[From]) - SUM(Table1[PREVIOUS_TO]) <> 1; 1; 0)
Also be aware the last range in your example was the first range (if it's ordered by FROM, it's this case you should order on M language by FROM column).
I hope it helps you,
Ricardo
Hi Baconbomb,
I think this case has to be solved using either M and DAX, I tried to follow:
M ->
Add an index to this table;
DAX ->
I've created a calculated column to get the previous TO column value:
PREVIOUS_TO = SELECTCOLUMNS(FILTER(Table1; Table1[Index] = EARLIER(Table1[Index]) - 1); "To"; Table1[To])
After that a measure calculating the gap between the previous TO with the current FROM:
_GAP = IF(SUM(Table1[From]) - SUM(Table1[PREVIOUS_TO]) <> 1; 1; 0)
Also be aware the last range in your example was the first range (if it's ordered by FROM, it's this case you should order on M language by FROM column).
I hope it helps you,
Ricardo
- Baconbomb8 years agoHelper I
It works greate thank you