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
michael_knight
Post Prodigy
Post Prodigy

Datediff Excluding Sunday

Hi,

 

Does anyone know how I can do a DateDiff but excluding Sunday? It seems this is easier said than done! 

 

Capture.PNG

With this example the DateDiff between the two dates is 5. Excluding Sunday it should be 4

 

This the the PBIX file: https://www.dropbox.com/s/raye0i6xfvr0h9y/dates.pbix?dl=0

 

Thanks,

Mike

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

https://www.dropbox.com/s/oaq85z3v79hlq77/dates.pbix?dl=0 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
michael_knight
Post Prodigy
Post Prodigy

Good stuff, thank you @Jihwan_Kim 

Jihwan_Kim
Super User
Super User

https://www.dropbox.com/s/oaq85z3v79hlq77/dates.pbix?dl=0 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi,

 

Thank you for that. I'm wondering, this was only sample data and I'd implement this on multiple DateDiff functions, will I need to create a calendar table for each measure?

 

Thanks

In my opinion, I think one calendar table might be enough if it can cover your business requirement. 

The reason why I created the new calendar table is that the existing dates table did not cover all dates in the fact table.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.