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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors