Forum Discussion
Calculating Sales based on Hours
Hi all! I hope youre having a good day!
Just want to ask for help on how to compute for sales based on time interval. My data looks like this:
Date Time Product Amount
1/1/2020 07:00 Product 1 100
1/1/2020 09:00 Product 2 200
1/1/2020 09:50 Product 1 100
My desired output is to compute for the total amount between 07:00 to 09:00 only. My calendar table consists of only dates without hours. I hope you can help me!
Thank you very much!
jmcph , You can create a time Calendar and use time slicer or a measure like this
calculate([measure], filter(Table, table[time] >=time(7,0,0) && table[time]<=(9,0,0)))
For time table refer:
https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/
2 Replies
- amitchandak
Super User
jmcph , You can create a time Calendar and use time slicer or a measure like this
calculate([measure], filter(Table, table[time] >=time(7,0,0) && table[time]<=(9,0,0)))
For time table refer:
https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/
- jmcph
Helper III
Thank you very much! This works! Accepted it as solution! Thanks again!