Forum Discussion
Filter by date and time
- 3 years ago
Hi , Atis112
According to your description, you want to filter the data from previous day 6am to today 6am.
Here are the steps you can refer to :
(1)This is my test data:
(2)We can create a measure like this:
Measure = var _today = TODAY() var _previoud_day = TODAY()-1 var _cur_day = MAX('Table'[Date]) var _cur_time = MAX('Table'[Time]) return IF( OR( _cur_day= _today && _cur_time<= TIME(6,0,0) , _cur_day= _previoud_day && _cur_time>= TIME(6,0,0) ) ,1,-1)(3)Then we can put the measure on the visual and configure it:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hello,
Yes, You can find it here:
| Part number | ID | Date | Time | Quantity |
| 123456789x | 1234 | 2023.02.03 | 5:45 | 1 |
| 123456799x | 1235 | 2023.02.03 | 6:30 | 5 |
| 123456789x | 1236 | 2023.02.03 | 22:20 | 110 |
| 123456799x | 1237 | 2023.04.04 | 23:45 | 78 |
| 123456789x | 1238 | 2023.04.04 | 3:10 | 67 |
| 123456799x | 1239 | 2023.04.04 | 16:22 | 50 |
| 123456789x | 1240 | 2023.02.01 | 5:10 | 765 |
| 123456799x | 1241 | 2023.02.02 | 6:11 | 864 |
| 123456789x | 1242 | 2023.02.03 | 17:15 | 324 |
| 123456799x | 1243 | 2023.02.04 | 14:11 | 23 |
| 123456789x | 1244 | 2023.02.05 | 18:44 | 234 |
| 123456799x | 1245 | 2023.02.06 | 21:34 | 56 |
| 123456789x | 1246 | 2023.02.07 | 8:10 | 876 |
| 123456799x | 1247 | 2023.03.01 | 11:43 | 43 |
| 123456789x | 1248 | 2023.02.09 | 11:01 | 34 |
| 123456799x | 1249 | 2023.02.10 | 18:30 | 76 |
Thank you very much!