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,
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?
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.