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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
vicky2123131
Frequent Visitor

Cannot convert value '6/4/' of type Text to type Integer.

Hi,

I'm getting this error " Cannot convert value '6/4/' of type Text to type Integer. " 

below screen shot id the sample "created date" column data

vicky2123131_0-1683181726666.png

Below is the calculated column used:

 

In Created Date = Date(Left(LOOKUPVALUE('Dim_In'[CreatedDate],
Dim_In[Id],
Vw_GC_In_Benefit_Pvt_Data_SnapShot[In ID]),4),Mid(LOOKUPVALUE('Dim_In'[CreatedDate],
Dim_In[Id],
Vw_GC_In_Benefit_Pvt_Data_SnapShot[In ID]),6,2),Mid(LOOKUPVALUE('Dim_In'[CreatedDate],
Dim_In[Id],
Vw_GC_In_Benefit_Pvt_Data_SnapShot[In ID]),9,2))
3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @vicky2123131 ,

 

Please try:

In Created Date =
VAR _date =
    LOOKUPVALUE (
        'Dim_In'[CreatedDate],
        Dim_In[Id], Vw_GC_In_Benefit_Pvt_Data_SnapShot[In ID]
    )
VAR _month =
    LEFT ( _date, FIND ( "/", _date, 1 ) - 1 )
VAR _day =
    MID (
        [Column1],
        FIND ( "/", _date, 1 ) + 1,
        FIND ( "/", _date, FIND ( "/", _date, 1 ) + 1 )
            - FIND ( "/", _date, 1 ) - 1
    )
VAR _year =
    RIGHT ( _date, 4 )
RETURN
    DATE ( _year, _month, _day )

Or 

In Created Date2 =
VAR _date =
    LOOKUPVALUE (
        'Dim_In'[CreatedDate],
        Dim_In[Id], Vw_GC_In_Benefit_Pvt_Data_SnapShot[In ID]
    )
RETURN
    DATE ( YEAR ( _date ), MONTH ( _date ), DAY ( _date ) )

Final output:

vjianbolimsft_0-1685089452308.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ahmedx
Super User
Super User

Share sample pbix file to help you.

lbendlin
Super User
Super User

looks like the year is missing from your data, and Power Query is guessing that you mean the current year.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.