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
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, v-yueyunzh-msft
Whoa. Yes, that's what I meant. Very perfect! Thank you very much for your help and the description of the process. It totally solved the problem!
I have another question on the same subject:
How can I set up slicer to list out based on start date start time and end date and end time. For example, with a slicer of four, can this be done? Do you have any ideas for this?