Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
For a automated reppord i want to change the date in my url to the first day of the previouse month and the last day of the previuouse month. I got it to work with this querry but the url is still not working becasue it is expacting a date format of yyy-mm-dd. How can i change the date format in this querry? I don't want to change the date format of my whole power bi, just in this querry.
Solved! Go to Solution.
Hi, @Anonymous
You may modify your query as below to see if it helps.
let
start = Date.ToText( Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd" ),
end = Date.ToText( Date.StartOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd"),
...
in
...
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, thanks for helping me with the date time issue, it worekd as intended when changing mm to MM. However, i now get the following error in the querry:
This has probably something to do with the date variables but i have no idea why it is not working
Hi, @Anonymous
Based on the error message, it means Web.Contents only need 1 or 2 parameters while it provides 6 arguments. You need to use text connection symbols to connect text to form a url instead of comma separated.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
You may modify your query as below to see if it helps.
let
start = Date.ToText( Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd" ),
end = Date.ToText( Date.StartOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd"),
...
in
...
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous
here some example how you can format a date to yy-mm-dd
= Date.ToText(Date.From(DateTime.FixedLocalNow()),"yy-MM-dd")
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |