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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
IvanS
Helper V
Helper V

Time visualizaiton (occupancy vs. availability)

Hello guys,

 

I have large datasets of charging of electric vehicles. Selected columns as per below:

 

- Location ID

- Connector ID (one Location can have multiple connectors)

- Charging from (date time)

- Charging to (date time)

 

What I want to achieve is to create visual that will show time utilization based on 15 minutes intervals (bins). It can be either tabular view (below) or graphical in form of project management's Gantt chart.

Example: if I have charging session that will start on 12.2.2025 at 18:02 and finish on 12.2.2025 at 19:14, I need to show it as per below:

 

 12.2.12.2.12.2.12.2.12.2.12.2.12.2.12.2.12.2.
Location ID17:3017:4518:0018:1518:3018:4519:0019:1519:30
ABC-01(blank) or green (blank) or greenX or redX or redX or redX or redX or red (blank) or green (blank) or green
ABC-02         
...         

 

Please note that charging session can last also overnight - e.g. starting from 12.2. 23:30 until 13.2. 1:15. This must be reflected in the visual.

Also there can be multiple charging sessions on one location at given time (due to multiple connectors).

 

What is the best way to achieve this result?

 

Thank you for any help!

Ivanuska

 

 

1 REPLY 1
FarhanJeelani
Super User
Super User

Dear @IvanS ,

-- Create a table with 15-minute intervals

TimeIntervals =
ADDCOLUMNS(
GENERATE(
CALENDAR(DATE(2025,1,1), DATE(2025,12,31)),
SELECTCOLUMNS(
GENERATESERIES(TIME(0,0,0), TIME(23,45,0), TIME(0,15,0)),
"Time", [Value]
)
),
"DateTime", [Date] + [Time]
)

 

-- Create a measure to check if charging session is active during each 15-minute interval

ChargingStatus =
VAR CurrentInterval = SELECTEDVALUE('TimeIntervals'[DateTime])
RETURN
IF(
CALCULATE(
COUNTROWS('ChargingData'),
FILTER(
'ChargingData',
'ChargingData'[Charging from] <= CurrentInterval && 'ChargingData'[Charging to] > CurrentInterval
)
) > 0,
"X", -- or use a color indicator like "Red"
BLANK() -- or use a color indicator like "Green"
)

 

-- Use a Matrix visual with Location ID as rows, Time Intervals as columns, and ChargingStatus as values.
-- Alternatively, create a Gantt-like visual using a custom visual from the Power BI marketplace, linking the ChargingStart and ChargingEnd times to the Gantt chart start and end dates.

 

Please mark this as solution if it helps you. Appreciate Kudos.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.