Forum Discussion
Customer Count - Start Time and end time
- 6 years ago
Hi ctashwin ,
If you need to count customers for each hour of each day, you need to create two calculated columns to format date and create the following measure:
Count = var _time = SELECTEDVALUE('Time'[Time]) var _count = CALCULATE( COUNTROWS('Table'), FILTER( ALL('Table'), _time >= 'Table'[Start] && _time <= 'Table'[End] ) ) return IF( ISBLANK(_count),0,_count )Here is the sample that you can refer: sample file.pbix
If you just count customers for each hour instead of each hour of each day, you can refer this issue: Counting numbers per hour between a start and end time
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi ctashwin ,
If you need to count customers for each hour of each day, you need to create two calculated columns to format date and create the following measure:
Count =
var _time = SELECTEDVALUE('Time'[Time])
var _count =
CALCULATE(
COUNTROWS('Table'),
FILTER(
ALL('Table'),
_time >= 'Table'[Start] &&
_time <= 'Table'[End]
)
)
return
IF(
ISBLANK(_count),0,_count
)Here is the sample that you can refer: sample file.pbix
If you just count customers for each hour instead of each hour of each day, you can refer this issue: Counting numbers per hour between a start and end time
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.