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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
MikeSW
New Member

Eventlogg

Hi

 

I have a table where a system logs each time a session ends. When that occurs, I get a log which tells me Who, when it started, and when it ended.

From that I want to show how many that where active for each hour for a period of time. 

And I want to be able to use the table as filter


ID;Name;Start;End
E.g.
"123456BA";"Mikael";"2020-05-11 12:03";"2020-05-11 15:03"
"123456BC";"Ann";"2020-05-11 10:15";"2020-05-11 12:03"

"123456BD";"Tom";"2020-05-11 13:23";"2020-05-11 16:01"
I would like to get a graph that show all logs that was active for each hour.
The graph should have time as the X Line, and the count of logs that has the time between the date.
E.g.

 

The above would be:
2020-05-11 10:00 0

2020-05-11 11:00 1

2020-05-11 13:00 1

2020-05-11 14:00 2

2020-05-11 15:00 2

2020-05-11 16:00 1

 

( I know that I miss out on those that are shorter than one hour)


I dont know if all this makes sense.

 

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @MikeSW ,

 

Would you please use the following measure:

 

Measure =

VAR A =

    MAX ( Table2[time] )

RETURN

    CALCULATE (

        COUNTROWS ( 'Table' ),

        FILTER ( ALL ( 'Table' ), 'Table'[Start] <= A && 'Table'[End] >= A )

    ) + 0

 

Untitled picture.png

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ef8dUQMVWjpOkJ9FR5...

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @MikeSW ,

 

Would you please use the following measure:

 

Measure =

VAR A =

    MAX ( Table2[time] )

RETURN

    CALCULATE (

        COUNTROWS ( 'Table' ),

        FILTER ( ALL ( 'Table' ), 'Table'[Start] <= A && 'Table'[End] >= A )

    ) + 0

 

Untitled picture.png

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ef8dUQMVWjpOkJ9FR5...

 

Best Regards,

Dedmon Dai

Thanks, that worked very well.

A follow up question, is it possible to link those 2 tables so I can use the logtable as a filter ?

@v-deddai1-msft 

Hi @MikeSW ,

 

I didn't see two tables in your original post. Would you please verify it?

 

Best Regards,

Dedmon Dai

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

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

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.