Forum Discussion
filtering timebins
- 6 years ago
Hi, Anonymous
Based on my research, I created data to reproduce your scenario.
DateTime bins Table:
DateTime bins Table = SELECTCOLUMNS( GENERATE( CALENDAR(MIN('Table'[enddatetime]),MAX('Table'[enddatetime])), GENERATESERIES( TIME(00,0,0), TIME(23,59,0), TIME(0,15,00) ) ), "Datetime",[Date]+[Value],"Date",[Date],"Time",[Value] )Table:
Then you may create two measures as follows.
IsCount = var _currentmax = SELECTEDVALUE('DateTime bins Table'[Datetime]) var _currentmin = SELECTEDVALUE('DateTime bins Table'[Datetime])-1/24/4 var _currentstart = MAX('Table'[startdatetime]) var _currentend = MAX('Table'[enddatetime]) return IF( NOT( OR(_currentstart>_currentmax,_currentend<_currentmin) ), 1,0 ) CountNumber = IF( HASONEVALUE('DateTime bins Table'[Datetime]), COUNTROWS( FILTER( 'Table', [IsCount] = 1 ) ), 0 )Finally you can use the 'DateTime' column to as a slicer to filter how many 'id_details' between the corresponding datetime and 15 minutes before the datetime.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Hi, Anonymous
You may create a table visual with the Datetime column from DateTime ins Table and drag the 'CountNumber' measure into the visual.
Here is the result. You can also use the highlight filter to see the detailed result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Based on my research, I created data to reproduce your scenario.
DateTime bins Table:
DateTime bins Table =
SELECTCOLUMNS(
GENERATE(
CALENDAR(MIN('Table'[enddatetime]),MAX('Table'[enddatetime])),
GENERATESERIES(
TIME(00,0,0),
TIME(23,59,0),
TIME(0,15,00)
)
),
"Datetime",[Date]+[Value],"Date",[Date],"Time",[Value]
)
Table:
Then you may create two measures as follows.
IsCount =
var _currentmax = SELECTEDVALUE('DateTime bins Table'[Datetime])
var _currentmin = SELECTEDVALUE('DateTime bins Table'[Datetime])-1/24/4
var _currentstart = MAX('Table'[startdatetime])
var _currentend = MAX('Table'[enddatetime])
return
IF(
NOT(
OR(_currentstart>_currentmax,_currentend<_currentmin)
),
1,0
)
CountNumber =
IF(
HASONEVALUE('DateTime bins Table'[Datetime]),
COUNTROWS(
FILTER(
'Table',
[IsCount] = 1
)
),
0
)
Finally you can use the 'DateTime' column to as a slicer to filter how many 'id_details' between the corresponding datetime and 15 minutes before the datetime.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hi Allan!
Thanks so much for your time! I really appreciate it!
I think that i have not been clear enough on how i expect the result to look like:I would like a table like this:
Date
Timebin
Number of customers
17/09/2019
00:00:00
x
17/09/2019
00:15:00
x
17/09/2019
00:30:00
x
17/09/2019
00:45:00
x
...
30/09/2019
23:45:00
x
Thanks again!
- v-alq-msft6 years agoCommunity Support
Hi, Anonymous
You may create a table visual with the Datetime column from DateTime ins Table and drag the 'CountNumber' measure into the visual.
Here is the result. You can also use the highlight filter to see the detailed result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.