Forum Discussion

Sheelaaryal's avatar
Sheelaaryal
Frequent Visitor
2 years ago
Solved

Weeknum for accounting period

How to calculate the week number based on the accounting periods, I have accounting periods 1, 2, 3, ...12 in my data and I am looking to calculate the number of weeks in each accounting period.   ...
  • ryan_mayu's avatar
    ryan_mayu
    2 years ago

    is this what you want?

     

    weeknum =
    var _first=CALCULATE(min('Table'[Date]),ALLEXCEPT('Table','Table'[accountin period]))
    return rounddown(('Table'[Date]-_first)/7,0)+1
     
     
    pls see the attachment below