Forum Discussion

Rigolleto's avatar
Rigolleto
Resolver I
6 years ago
Solved

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

 

 

  • 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

2 Replies

  • az38's avatar
    az38
    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))
  • v-juanli-msft's avatar
    v-juanli-msft
    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