Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Shalaka1
Regular Visitor

How to convet year week number to date

Hi,

I have year and weenumber and I need to convert this to date 

for example : I have 202237 , here 2022 is date and 37 is weeknumber and I need to convert this to date without dax.

could you please help me to sort out this issue. 

 

Thanks.

2 REPLIES 2
Ahmedx
Super User
Super User

plse try this
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26Rh00C0uCitb4Nd7qQ?e=5s8ai9

[
Y = Number.From(Splitter.SplitTextByLengths({4, 2})( Text.From(
    [#"Year-week"])){0}),
W =Number.From(Splitter.SplitTextByLengths({4, 2})( Text.From([#"Year-week"])){1}),   
 D =  List.Select(
 List.Generate(()=>#date(Y,1,1),(x)=>x<=#date(Y,12,31),(x)=>Date.AddDays(x,1)),(x)=> Date.Year(x) = Y and Date.WeekOfYear(x)=W) 
     ][D]

Screen Capture #946.pngScreen Capture #947.pngScreen Capture #948.png

Idrissshatila
Super User
Super User

Hello @Shalaka1 ,

 

check this solution https://community.powerbi.com/t5/Desktop/convert-week-number-into-data/td-p/88227

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.