Forum Discussion

JCG99's avatar
JCG99
Regular Visitor
2 years ago

DAX islands and gaps problem [generic answer]

Hello everyone, 

 

I looked elsewhere to find solution to my problem. But none of them really handles the problem I am having. 

I have a big table that displays data, with one metric, the distance. Basically different charecterics on different section of the road. 

 

The user selects which category to display in the visual, and a table 'summarize' the characteristics to the different section of the road. This is very similar to the standard islands and gap problems, only I am [distance] instead of [timestamp].

 

I want to define a measure than computes the islands, and thus the min max of each region.

 

The naïve method, is just about computing min/max over all selected columns, but the result is incorrect as the gaps are not shown. 

 

Here is an example:

 

This is the struture of my table:

From | To | Category 1 (if selected) | Category 2 (if selected) | ..... 

 

Can someone give me a hint, or a generic answer of how I could achieve this ?

 

I have tried to apply the same logic I would, if I was writing a query in SQL, but I can't get it worked.

 

Any ideas, suggestions of which reasoning I should use ? 

 

Thank you