The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All, I've one query, I've two dates like start date is 10/01/2022 09:06:03 and end date is 30/01/2022 06:05:01 and I need time difference that should excludes:
- Non working Hrs like here working hrs is starts 09:00:00 and ends 17:00:00
- Weekoff Sat and Sun
- Holidays - 20/01/2022
Please help me out.
Thanks!
Solved! Go to Solution.
This is much more complex than you may expect. You have to account for all kinds of corner cases (for example when the clock starts on a work day but before 9am or after 5pm etc).
Here is a sample implementation that returns the resulting day fractions. You can multiply the sum by 24 to arrive at the hours, or leave as is and interpret as duration.
The sample implementation is a proof of concept - you would have to provide a couple more test intervals to see how this could look like in production.
Where would you like to do that, in Power Query or in DAX? Are you aware of the NETWORKDAYS() function in DAX?
You also need to define what should happen if your interval starts or ends on a non-workday (in your example Janary 30 is a sunday). Should the hours still count or should they be ignored?
Thanks for Picking my query:
I've got the duration in HH:MM:SS format in Power Query with below query. but unable to calculation on Matrix Visual, However it given result in Power query.
it is taking zero in Matrix Visual.
This is much more complex than you may expect. You have to account for all kinds of corner cases (for example when the clock starts on a work day but before 9am or after 5pm etc).
Here is a sample implementation that returns the resulting day fractions. You can multiply the sum by 24 to arrive at the hours, or leave as is and interpret as duration.
The sample implementation is a proof of concept - you would have to provide a couple more test intervals to see how this could look like in production.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
79 | |
47 | |
39 |
User | Count |
---|---|
149 | |
110 | |
66 | |
64 | |
56 |