Forum Discussion
arieldorfman
6 years agoNew 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 Usuario StartTime EndTime D...
- 6 years ago
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 Source2)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:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto
v-gizhi-msft
6 years agoCommunity 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
Source2)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:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto
arieldorfman
6 years agoNew Member
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