Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
i have the following data
date/time | type |
19/9/2023 16:10:02 | A |
20/2/2023 16:10:02 | B |
20/2/2023 9:00:11 | B |
20/3/2023 12:22:34 | A |
i want the orders that comes after duty hours which is 7:00:00 to 15:00:00 to be included with the day after
so the order number 2 should be summed with the orders on 20/3/2023 because it came on 16:10:02 which is after 15:00:00
please help and thank you
Hi, @mina97
i am take these example
add column
put newdate and order to table
Did i answer your question? Mark my post as a solution which help other people to find fast and easily.
@mina97 , what's the desired output? Count orders per day? What do you do for the first order which is also outside your time range?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
@ERD hi i appreciate your help
what's the desired output?Count orders per day? yes count the orders py day with a condition which " if order came between the time 7:00:00 to 15:00:00 count it as today's orders if not count it with tommorrows orders. i hope it is clear
What do you do for the first order which is also outside your time range? the time range starts from 1/june/2018 and ends at today's date no matter what date is it today i need it to be automatically linked with today.
THANK YOU FOR CONSIDERATION and please help
@mina97 , I'm still not sure about the expected output. Anyway, you can try this measure to achieve the result according to my understanding:
Measure =
VAR real_dates =
ADDCOLUMNS (
'Table',
"@real_date",
VAR current_time = [Time]
VAR check_time =
current_time >= TIME ( 07, 00, 00 ) && current_time <= TIME ( 15, 00, 00 )
VAR current_date = [Date]
VAR check_date =
IF ( check_time, current_date, current_date + 1 )
RETURN
check_date
)
VAR t =
GENERATE (
VALUES ( 'Date'[Date] ),
VAR dt = 'Date'[Date]
RETURN
ROW ( "rows_amt", COUNTROWS ( FILTER ( real_dates, [@real_date] = dt ) ) )
)
RETURN
SUMX ( t, [rows_amt] )
Here I use a Date table, not connected to the data table:
Date in the first column is from the Date table.
If we compare with the original date:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |