Forum Discussion
How to create a Date column using Year and week combination
Hi team,
Can you please help me how to create a date column using year and week in powerbi. Thank you!
Ritaf1983 Greg_Deckler amitchandak Ashish_Mathur parry2k MFelix
4 Replies
- AnalyticPulse
Solution Sage
there would be confusion if you create a data column just by week and year, to get accurate date you need the day of the week and a month.
Learn Power BI free:
https://analyticpulse.blogspot.com
- kpost
Solution Sage
I agree 100%. That's why I asked what he or she means, specifically, by "week", also what the expected result is.
If for example he or she wants the last day of that week, and [week] is, let's say, a 0-indexed weeknum value essentially equal to FLOOR(DIVIDE(julian date, 7), 1) etc.
Then [YEAR] 2024 and [WEEK] 0 could mean January 7,2024.
I'm hoping for some more clarity and sample data from Usha_pk
- kpost
Solution Sage
Please define more clearly what you mean by "week" (it can mean a lot of different things), and provide a screenshot of some sample data.
Then tell us what the expected result is, based on those two columns.
- AnonymousNot applicable
Hi all,
First of all, thank you all for your prompt responses.
Hi Usha_pk ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Add a custom column.
Date.StartOfWeek(Date.AddWeeks(#date([Year], 1, 1), [Week]-1))How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.