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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.