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
arieldorfman
New Member

concurrent users

Hi all

im new at PBI, and i have this situation

we need to have how many concurrent users are loged in to our platform every minute

i have this table, in xls 

 

UsuarioStartTimeEndTimeDuration
A20/03/20 08:04:4320/03/20 10:04:43N/A
B17/03/20 15:06:2517/03/20 17:06:25N/A
B20/03/20 2:15:0420/03/20 2:16:0800:01:04
C20/03/20 2:30:1620/03/20 6:26:1603:56:01
B20/03/20 6:48:1420/03/20 6:49:1900:01:06
D20/03/20 6:56:3620/03/20 7:07:3700:11:01

 

how is the best way to have this metrics?

thanks in advance!

Ariel

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

Hi,

 

Please take following steps:

1)Create a new query in Query editor:

let
    Source = List.DateTimes(#datetime(2020,1,1,03,00,00),100,#duration(0,0,1,0)) 
in
    Source

2)After Apply&Close this query, try to create two columns in original data table:

Start = DATE(YEAR('Table'[StartTime]),MONTH('Table'[StartTime]),DAY('Table'[StartTime]))+TIME(HOUR('Table'[StartTime]),MINUTE('Table'[StartTime]),0)
End = DATE(YEAR('Table'[EndTime]),MONTH('Table'[EndTime]),DAY('Table'[EndTime]))+TIME(HOUR('Table'[EndTime]),MINUTE('Table'[EndTime]),0)

3)Try this measure:

Count of User per minute =
SUMX (
    DISTINCT ( Query1[Query1] ),
    CALCULATE (
        COUNTAX (
            FILTER (
                'Table',
                'Table'[Start] <= MAX ( Query1[Query1] )
                    && 'Table'[End] >= MAX ( Query1[Query1] )
            ),
            'Table'[Usuario]
        )
    )
)

4)The result shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please take following steps:

1)Create a new query in Query editor:

let
    Source = List.DateTimes(#datetime(2020,1,1,03,00,00),100,#duration(0,0,1,0)) 
in
    Source

2)After Apply&Close this query, try to create two columns in original data table:

Start = DATE(YEAR('Table'[StartTime]),MONTH('Table'[StartTime]),DAY('Table'[StartTime]))+TIME(HOUR('Table'[StartTime]),MINUTE('Table'[StartTime]),0)
End = DATE(YEAR('Table'[EndTime]),MONTH('Table'[EndTime]),DAY('Table'[EndTime]))+TIME(HOUR('Table'[EndTime]),MINUTE('Table'[EndTime]),0)

3)Try this measure:

Count of User per minute =
SUMX (
    DISTINCT ( Query1[Query1] ),
    CALCULATE (
        COUNTAX (
            FILTER (
                'Table',
                'Table'[Start] <= MAX ( Query1[Query1] )
                    && 'Table'[End] >= MAX ( Query1[Query1] )
            ),
            'Table'[Usuario]
        )
    )
)

4)The result shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

thanks @v-gizhi-msft and @Greg_Deckler both helped me with the idea, i used the @Greg_Deckler explanation that met better with my need!

Best

Ariel

Greg_Deckler
Community Champion
Community Champion

You need a variation of Open Tickets: https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.