Forum Discussion
MH3
4 years agoHelper V
Getting Date from Week Number and Year
Hi, I have a fact table in which I have Week Number and Year wise Sales I want to create a relationship of fact table with my calendar Table (Which have all dates from Year 2020 and 2021...
- 4 years ago
It's working well 🙂
MH3
4 years agoHelper V
Actually, The data was given on Week-Year basis
so I had splitted the week and year
= (TheYear as number, TheWeek as number) as date =>
let
//test
//TheYear = 2018,
//TheWeek = 1,
//
offsetToISO = Date.AddDays(#date(TheYear,1,1),-4),
dayOfWeek = Date.DayOfWeek(offsetToISO, Day.Monday),
offset = -dayOfWeek + (TheWeek * 7),
isoWeekDate = Date.AddDays(offsetToISO, offset)
in
isoWeekDate
and the StartWeek I had calculated by this Function
TomMartens
4 years agoSuper User
Hey MH3 ,
please take the time and create a pbix that contains sample data, including your M functions. Upload the pbix to onedrive or dropbox and share the link.
Regards,
Tom
- MH34 years agoHelper V
TomMartens I have sent you a private message kindly go through it.