Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hey everyone!,
I am trying to add in custom dates in an API URL. Example: I am converting
startDate=2024-12-01&endDate=2025-12-05
to
startDate=[Current Date]&endDate=[Start Date].
Here is what it looks like.
Hi @jbrown184
Did the solutions Omid_Motamedise , ZhangKun and lbendlin offered help you solve the problem, if them helps you can consider to accept them as solutions so that more user can refer to, or if you have other problems you can offer some infomrmation so that can provide more suggestion for you.
Best Regards!
Yolo Zhu
use the below formual
="startDate="&Text.From([Current Date])&"&endDate="&Text.From([Start Date])
If you just want to solve the problem, you only need to concatenate the strings:
"...&startDate=" & [Current Date] & "&endDate=" & [Start Date]
But for this slightly complex problem, decoupling should usually be done, that is, splitting the complex function into several small functions. Especially if there is some sensitive information in your problem.
For example, the following method first creates a function:
// just an example
(s, e) =>
// https://restapi.amap.com/v3/geocode/geo?startDate=xxx&endDate=yyyy&grouping[]=a,b,c
Web.Contents(
"https://restapi.amap.com",
[
Query=[
startDate = s,
endDate = e,
// because record don't support multiple same field names, the following method is used.
// most servers support this method to pass multiple parameters with the same field name.
#"grouping[]" = "a,b,c"
],
RelativePath="/v3/geocode/geo"
]
// other code
)
Then call the function fx in Table.AddColumn:
Table.AddColumn(tbl, "custom", each fx([Start Date], [Current Date]))
Please follow the documentation. Use RelativePath and Query parameters. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-1
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 6 | |
| 5 |