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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vendosoft
New Member

The value #date can not be converted to "Text"

Hi there,

 

I am trying to get a call record list from our VOIP Provider.

The given details are:

 

Name In Type Required Description

datequerystring(date)trueYYYY-MM-DD
pagequeryinteger(int32)falsePage of results to fetch.
per_pagequeryinteger(int32)falseNumber of results to return per page.

 

I tried to fetch it with the following:

 

= Json.Document(Web.Contents("https://api.placetel.de/v2/call_detail_records", [Headers=[Authorization="xxxx", date= DateTime.Date(DateTime.LocalNow()),today= date,
year = Number.ToText(Date.Year(today)),
month = Text.PadStart(Number.ToText(Date.Month(today)),2,"0"),
day = Text.PadStart(Number.ToText(Date.Day(today)),2,"0"),
mydate = year&"-"&month&"-"&day, page="10", per_page="50"]]))

 

The solution is:

Expression.Error: The value "#date(2020, 3, 20)" cannot be converted to the type "Text".
Details:
Value=20.03.2020
Type=[Type]

 

Any help for me?

Thanks a lot!

3 REPLIES 3
Vendosoft
New Member

Hello everyone,

 

I really, really need help with his, I have a deadline I need to met.

You would be a fantastic help!

 

Kind regards

Alex

V-pazhen-msft
Community Support
Community Support

@Vendosoft 

 

For dates, you should use Date.ToText instead of Number.ToText function. 

https://docs.microsoft.com/en-us/powerquery-m/date-totext

 

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

Hi there,

 

I tried it, now it says:

 

Expression.Error: Der Wert "23" kann nicht in den Typ "Date" konvertiert werden.
Details:
Value=23
Type=[Type]

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.