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
If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.
Best Regards
Allan
Thanks a million for your time! This was perfect!