Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Obtain Start of week by using Year-WeekNum column from Fact Table.

Hi Guyz,   Need Help!!..I need to Extract Week Start Date from Fact Tables. However, I have only Year with Week No in my fact table. My I know wthat is the actual Dax or Solution to my Query. I thi...
  • Paulien_'s avatar
    4 years ago

    Add this as a new custom column in Power Query (and maybe play around with it a little bit):

    Date.StartOfWeek(Date.AddWeeks(#date(Number.FromText(Text.Start([Year-WeekNo],4)), 1, 1), Number.FromText(Text.End([Year-WeekNo],2))), Day.Monday)

    However, I would recommend creating a seperate date dimension with the Year-WeekNo as a key and this new column as part of the date dimension. In this way you can also filter e.g. on week number or year.