Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Adding week number column to Date Dimension Table for specific rule.

Hello,

 

I am using the date dimensional table. In this table, I need DAX to define the week containing the 1st and the 7th day of the month as the 1st week. (For every month)
Ex: Days -> [1,7] = 1
                  [8,14] = 2
                  [15-21] = 3 ...

Thank you for your help.

  • Anonymous , try a new column like

     

    month week No = quotient(datediff([eomonth([date],-1)+1,[date],day),7)+1

2 Replies

  • Anonymous , try a new column like

     

    month week No = quotient(datediff([eomonth([date],-1)+1,[date],day),7)+1

    • Anonymous's avatar
      Anonymous
      Not applicable

      This is exactly what I want. Thank you so much. amitchandak