Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
im using #duration(0,7,30,0) in my Power Query. But i want it to be a parameter.
Now:
Table.AddColumn(#"Changed Typ", "WorkingDay", each [Date]- #duration(0,7,30,0))
I tried:
- creating a parameter with time = 0,7,30,0 and then using it in Power Query --> #duration(time)
- creating a parameter with time = #duration(0,7,30,0) and then using it in Power Query --> time
didnt work.
What did work:
- creating a paramter with time = 7 and then using it in Power Query --> #duration(0,time,30,0)
But i want both, hour and time to be a paramater. Is there a better way then using 2 parameter?
Solved! Go to Solution.
Hi @virus190
Create three blank queries, enter codes in Advanced editor,
hour list
let
Source = {1..24}
in
Source
minutes list
let
Source = {0..59}
in
Source
day list
let
Source = {0..30}
in
Source
Then create three parameters
Use parameter in table
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @virus190
Create three blank queries, enter codes in Advanced editor,
hour list
let
Source = {1..24}
in
Source
minutes list
let
Source = {0..59}
in
Source
day list
let
Source = {0..30}
in
Source
Then create three parameters
Use parameter in table
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello
Create a new blank query and name it like you want the parameter to be named. Then go to the advanced editor and paste in this code. This should do the trick
(#duration(0,7,30,0)) meta [IsParameterQuery=true, Type="Any", IsParameterQueryRequired=true]
you can then apply your parameter using a Syntax like
DateTime.LocalNow() + YouParameterName
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
Hello,
thank you very much. This does work.
But i want that the user to be able to change the duration from the parameter. Thats the goal.
Like this:
But change it from 7,30 to maybe 8,00
Is this possible?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.