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.
Hi all,
I have an API endpoint where I want to dynamically update the date to yesterday's date. However, the date needs to be in the format YYYY-MM-DD. This is my current attempt at doing this is by using this code:
Date.Year(DateTime.LocalNow()) & "-" & Date.Month(DateTime.LocalNow()) & "-" & Date.Day(DateTime.LocalNow()-1)
...in the context of the query it appears like this:
let
Source = Xml.Tables(Web.Contents("https://dataapi.xxxxxx.com/74daa799/v1/enterprise/73/events/xxxxxx/pages/created/2020-09-01;" & Date.Year(DateTime.LocalNow()) & "-" & Date.Month(DateTime.LocalNow()) & "-" & Date.Day(DateTime.LocalNow()-1) ))
in
Source
...when I run this I get the following error
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=https://dataapi.xxxxxx.com/74daa799/v1/enterprise/73/events/xxxxxx/pages/created/2020-09-01;
Right=2020
Can anyone suggest where I'm going wrong?
Thanks in advance,
Sam
Solved! Go to Solution.
Hi @Anonymous
The error message says you are trying to concatenate text and numbers. Convert the numbers to text with Text.From( ) or similar
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
The error message says you are trying to concatenate text and numbers. Convert the numbers to text with Text.From( ) or similar
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
48 | |
19 | |
13 | |
11 |