Forum Discussion

sem1's avatar
sem1
Frequent Visitor
5 years ago
Solved

Calculating the maximum distance across multiple rows?

Hello, I have a bit of a complicated question about calculating distances across rows. I wanted to see if you can help out. First, I will explain the data and goal then go over an example of what ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  sem1 ,

    According to your description, create the data and set the formula rule to [latitude] + [longitude].

    1. Create Measure.

    Measure =
    var _table=GENERATE(SELECTCOLUMNS(FILTER(ALL('Table'),[Journey]=MAX([Journey])),"jo1",[Journey],"Type",[Vehicle],"juli",[Longitude]+[Latitude]),SELECTCOLUMNS(FILTER(ALL('Table'),[Journey]=MAX([Journey])),"jo2",'Table'[Journey],"Type2",[Vehicle],"juli2",[Longitude]+[Latitude]))
    
    var _value=
    MAXX(_table,ABS([juli]-[juli2]))
    
    return
    IF(MAX('Table'[Event.1])="Disconnected",_value,BLANK())

    2. Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.