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
Anonymous
Not applicable

Date conversion

Hello,

 

I'm looking to get a conversion of a whole number date I have to an actual date. 

 

Current format is in week year ex. (192020) 

 

I would like this to read as May 4th 2020 or (4/4/2020) as the sunday is the first day of the calander year. 

 

Any help with this would be great, thank you!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

create a calculated column

Column = 
VAR _week = LEFT([Date],2)
VAR _year = RIGHT([Date],4)
RETURN
DATE(_year, 1, -2) - WEEKDAY(DATE(_year, 1, 3)) + _week*7

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hello everyone,

 

I am working on a CurryShots file and I want my Date to be displayed as DD/MM/YYYY. I tried changing the the data type using locale to English (uk) and English (Au) but it stills shows as this error;

 

"We couldn't parse the input provided as Date value.

Details:

     10/28/09"

 

Can anyone please help me solve this issue 🙂

Thankyou!

 

 

 

az38
Community Champion
Community Champion

Hi @Anonymous 

create a calculated column

Column = 
VAR _week = LEFT([Date],2)
VAR _year = RIGHT([Date],4)
RETURN
DATE(_year, 1, -2) - WEEKDAY(DATE(_year, 1, 3)) + _week*7

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 This formula works, but, with the one your provided. For the date range of (192020) I'm getting December 30th of 2019. Can you help me restructure the formula for that date range to bring back 5/3/2020?

az38
Community Champion
Community Champion

Hi @Anonymous 

for me it works

Снимок.PNG

 

what kind of Date lead you to mistake?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38  I figured it out. My original number was still sitting in text format. Needed to be changed over to whole number. Thank you very much for your help!

@kfitz20

it must work with the text data type as well

az38
Community Champion
Community Champion

@Anonymous 

it should work with text data type as well


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

2020-05-12_9-43-49.png

Anonymous
Not applicable

@az38 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.