Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AvanderKnijff
New Member

Tracking dashboard

Hi Guys,

 

I want to create a dashboard showing the rides of assets. I have a table listing tracking events like start, moving, stop. So a typical Ride for one device has a start, one or more moving records and a stop record.

 

TimeDeviceIDeventTypelatlon

msgCounter

12:001start00

1

12:051moving11

2

12:101moving12

3

12:151stop13

4

 

Now the trouble is that I have one table for multiple assets.  like;

 

TimeDeviceIDeventTypelatlon

msgCounter

12:001start00

1

12:022moving11

2

12:101moving12

2

12:154start13

4

12:151stop13

3

12:162stop22

3

12:174moving22

5

12:204stop23

6

 

To be able to show rides on a dashboard I need to create a unique RideID for every ride of a given device

 

TimeDeviceIDeventTypelatlon

msgCounter

RideID

12:001start00

1

1

12:022moving11

2

2

12:101moving12

2

1

12:154start13

4

1

12:151stop13

3

1

12:162stop22

3

2

12:174moving22

5

1

12:204stop23

6

1

12:301start13

4

2

12:311moving13

5

2

21:321moving14

6

2

21:331stop15

7

2

21:362start22

4

3

 

With the RideID I should be able to create a unique column by concatinating rideid with deviceid. With that colum I would than be able to filter in a dashboard.

 

Any tips or sugestions how to calculate the RideId colum?

 

thanks in advance KR Arjen

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AvanderKnijff ,

 

Group the table by stop time:

Column = 
var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
return
IF(ISBLANK(_end),'Table'[Time],_end)

Then rank the group in same device ID.

Column = 
var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
return
IF(ISBLANK(_end),'Table'[Time],_end)

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @AvanderKnijff ,

 

Group the table by stop time:

Column = 
var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
return
IF(ISBLANK(_end),'Table'[Time],_end)

Then rank the group in same device ID.

Column = 
var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
return
IF(ISBLANK(_end),'Table'[Time],_end)

 

Best Regards,

Jay

Hi Jay,

 

Thanks for your help, I managed to do the group by. This realy helps! I'm able to do a filter based on time.

 

The ranking would be helpfull to be able to list the start and end of a given ride on one row. However, the given ranking formula is a duplicate of the grouping. Could you share the ranking formula or do I misunderstood your solution?

 

First, step now is to understand the first formula 🙂

 

Thanks in advance, KR Arjen

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.