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
Rigolleto
Resolver I
Resolver I

Calculate total weeks between two dates

Hi,

 

I need some M code in order to calculate the number of weeks between to dates, someone could help me how can I handle this issue, also I was able to handle this using DAX but, I need to calculate the total weeks on Power Query side

 

Thanks

 

 

Capture.PNG

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Rigolleto 

As tested, az38's suggestion is helpful.

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?
If not, please let me know.
 
Best Regards
Maggie

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Rigolleto 

As tested, az38's suggestion is helpful.

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?
If not, please let me know.
 
Best Regards
Maggie
az38
Community Champion
Community Champion

Hi @Rigolleto 

I've got no  idea how do you get 5 weeks from 28-days period but try a custom column like

= Number.RoundUp(Number.From(([end day]-[Start day])/7))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.

Top Solution Authors
Top Kudoed Authors