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.
what is the best way to calculate a date 2 years back, from the beginning of the current month and then pass that to a filter in all the tables you importing into a model.
Ive tried this but it doesn't seem to be coming together..
Ive created a calculated table in power query by placing in this in a blank query. It comes up with the correct date.
= Date.AddYears(Date.StartOfMonth(DateTime.Date(DateTime.LocalNow())),-2)
this returns athe correct value, but can't figure out how to pass it to a parameter, at its not showing as an available query when i create a new parameter, what is the best way to do this?
thanks
Proud to be a Super User!
Solved! Go to Solution.
Hi @vanessafvg
What you could potentially do is the following.
In the Query Editor where you have created your Date going back 2 years, Convert this to a List.
Then create a new Parameter, when it asks for the Suggested Values, change this in the Drop Down to Query.
This will then give you an option for which Query to use.
You can now select the List that you converted above.
Now that you have it set as a Parameter, you can simply use this Parameter in your filters.
There is another way to do this, if it does not work, which is to manually create it in the Advanced Editor, but is a bit more complex. So if you can try the above suggestion first?
i would really aprpeciate a response on this if anyone knows 🙂 as i am totally stuck on how to make this dynamic
Proud to be a Super User!
Hi @vanessafvg
What you could potentially do is the following.
In the Query Editor where you have created your Date going back 2 years, Convert this to a List.
Then create a new Parameter, when it asks for the Suggested Values, change this in the Drop Down to Query.
This will then give you an option for which Query to use.
You can now select the List that you converted above.
Now that you have it set as a Parameter, you can simply use this Parameter in your filters.
There is another way to do this, if it does not work, which is to manually create it in the Advanced Editor, but is a bit more complex. So if you can try the above suggestion first?
I am having an issue passing date parameters to a pentaho web service, but when passing parameter as date it says:
We cannot apply operator & to types Text and Date.
Below is the call that is being made to the web service on my local machine.
Parameter name is date_start
Web.Contents("http://localhost:8081/kettle/executeTrans/?trans=E:\pentaho\dashboard.ktr&date_start="&date_start)
I can not use data type of the parameter as text as i have used slicer on the dashboard and that parameter is passed as the starting date to it, and it only accepts the date data type param.
what should i do with it?
Hi shzincu,
Please post your quetion as a new topic.. this issue has already been solved so people are less likely to respond.
Not sure what you should do but I would try to cast the date to text before you append it? e.g.
Web.Contents("http://localhost:8081/kettle/executeTrans/?trans=E:\pentaho\dashboard.ktr&date_start="&Text.From(date_start))
sorry the syntax is probably wrong but I hop you get the idea.
aha i think it might work with the list! i only just noticed that you convert to list or table. , i just hope it stays dynamic, thanks
Proud to be a Super User!
it doesn't seem to be working, i have pointed it to the list to pass to the parameter, but the parameter doesn't seem to be populating?
Proud to be a Super User!
Hmm.. this can be tricky depending on the data source:
if its in SQL DB its easy.. is it a SQL source?
Cheers
Greg
unfortunately the source is in csv format
Proud to be a Super User!
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |