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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DennisJung
Helper I
Helper I

Date Convert problem

hey,

 

i have an problem to convert simple text to a date since today, and i dont know why. (it worked till yesterday)

 

i have the following rows / dax formula:

 

 

This is the row i need to convert. If i change the format, i get an error. (text to date not possible)

 

So, i used these formulas to extract part of the dates and put it together.

 

Jahr = PATHITEM(SUBSTITUTE(StandardVerkauf[Verkaufsvorgang.Vorgangsdatum];"-";"|");1)

 

Monat = PATHITEM(SUBSTITUTE(StandardVerkauf[Verkaufsvorgang.Vorgangsdatum];"-";"|");2)

 

Datum = StandardVerkauf[Monat] & "." & StandardVerkauf[Jahr]

 

Jahr = Year, Monat = Month, Datum = Date (translation)

 

 

This results in this

 

 

 

The row Datum is set to Date Format and it worked perfectly till today. When i now update / refreseh my dataset, i get the following error for the column Datum.

 

 

Translation: The Value "." of type text can not be converted to the type date.

 

Same if i try to convert only the year.

 

Datum = StandardVerkauf[Jahr]

 

Same error.

 

Can someone help me please? 🙂

 

 

 

2 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

@DennisJung

 

Try in Query Editor--Transform--Date--Parse

 




Lima - Peru

View solution in original post

v-shex-msft
Community Support
Community Support

Hi @DennisJung,

 

You can use power query date functions to split the date column, add a custom column to store them.

Sample:

    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Year", each Date.Year([Created])), 
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "YearMonth", each Date.ToText([Created],"yyyy.MM"))

 

Reference link:

Date functions

Date.ToText

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @DennisJung,

 

You can use power query date functions to split the date column, add a custom column to store them.

Sample:

    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Year", each Date.Year([Created])), 
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "YearMonth", each Date.ToText([Created],"yyyy.MM"))

 

Reference link:

Date functions

Date.ToText

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Vvelarde
Community Champion
Community Champion

@DennisJung

 

Try in Query Editor--Transform--Date--Parse

 




Lima - Peru

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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