Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
armely
Helper I
Helper I

Datesbetween

am trying to incorporate hours in datesbetween, we have a need where it can be a dates plus 30hrs to show a range of activities. Datesbetween and periods only allows me to do dates instead of hours. Any suggestions on how to incorporate time.

Thanks
1 ACCEPTED SOLUTION

@armely ,

 

You may add a separate table for Slicer, use DATEDIFF to apply virtual relationship in DAX measure and then take advantage of Visual level filters.

https://community.powerbi.com/t5/Desktop/Use-a-date-slicer-to-filter-on-a-period-instead-of-a-single...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@armely Try this as a New Column.... Instead of 30hrs splitted that into 1 Day 6 Hours....

 

TimeAdd = DATEADD(_Date[Date],1,DAY) + TIME(6,0,0)

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




where this is tricky is time will vary from date to date. If we have a dataset as follows
3/10/19 1:00
3/10/19 3:00
3/12/19 10:00
3/12/19 14:00
3/13/19 12:00
and a user picks 3/13/2019 08:00 AM, then we want to subtract 30hrs from it so the result set will be between 03/12/2019 02:00 AM and 3/13/2019 08:00 AM thus the result should be as follows
3/12/19 10:00
3/12/19 14:00

@armely ,

 

You may add a separate table for Slicer, use DATEDIFF to apply virtual relationship in DAX measure and then take advantage of Visual level filters.

https://community.powerbi.com/t5/Desktop/Use-a-date-slicer-to-filter-on-a-period-instead-of-a-single...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.