Forum Discussion
Parameter with Query as Source
- 5 years ago
this
lol
FILTER('PFR Date','PFR Date'[PFR Week]=VALUE(" & Text.From(SELECTED_PFR_WEEK) & ")),"
Hi Jimmy,
Thanks for this - I had already managed to achieve this last night but this doesn't use parameters at all (only a named list)
it's fine - it does the job, but I'm still lost as to what the purpose of a parameter with a query as source is in excel... it never picks up the values and relies on the 'current value' field anyway...
Thanks for your help on this
Ryan
Hello rh203
so, when it does the job, why still not satisfied? 😉
Parameters are useful when you transform a Query into a function. There you need a parameter. The advantage is that you use the query to change your function automatically. And when you are using a query to feed your parameter you can change the settings in your Excelsheet instead in the parameter-section
Hope this helps
Jimmy
- rh2035 years agoHelper I
Hi Jimmy,
I'm satisfied I have something which 'does the job' but I like to always find out the correct / best way of doing something which I might need in the future also.
In an ideal world I would like to pass this value into a DAX query which is being sent to the SSAS to collect the source data - I understand this may be possible using parameters but not so sure on just using a 'list'... any ideas?
thanks
- Jimmy8015 years agoCommunity Champion
Hello rh203
passing data to a DAX-query in Power Query has nothing to do if you are using parameters or not. I don't know how your DAX-query is looking like, but lets take an example that want to add a filter in DAX, that takes a text string like "[Project number].[M-121-12345],[Project number].[M-117.64455]" then you can use a list of Project number like {"M-121-12345", "M-117-64455"} transform it to the above mentioned format and use Text.Combine to get an text string, connecting both with a ",". This text string you can then input in your DAX-query
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- rh2035 years agoHelper I
Thanks Jimmy,
I actually only need to pass a single value (stored in a list) and don't need to do any combining at all.
is there a way to pass a single value (or a single value from a list) in the way you explained?
(I don't need to do any combination of text before sending the value into the DAX query)
thanks
ryan