Forum Discussion
SAP BW BEx Dynamic Parameters
- 8 years ago
Hi Anonymous,
You can follow below blogs to use query parameter in M query.
Power BI Desktop Query Parameters, Part 1
Power BI Desktop Query Parameters, Part2 – Dynamic Data Masking and Query Parameters
Regards,
Yuliana Gu
We have a BW Query on Accounts Receiveable and use a dynamic filter for today's date. Rest of the logic in the report is based on this variable.
I am able to create a report on this query, issue is when i refresh next day the dynamic variable date does not change to today's date as it happen in Bex.
What is the solution for this.
thanks,
MAT.
Are you using this variable in your M script like the example I posted? Or are you creating a parameter and driving your data refresh with the parameter?
If your using M script, similar to how I posted in the initial post then post you M code so we can see how your doing this.
- Anonymous6 years agoNot applicable
this is what i have and need to pass today's date. I am new to PowerBI.
- Anonymous6 years agoNot applicable
Anonymous ,
Look at my original post, it has this exact example.
There are a couple of ways you can do it but this should work. Based on this code you could create a todays date value and pass that value in or create another field that contains the formatted value that needs to be passed to sap bw.
You can then use this two different ways. One way is to create a paramter with the parameter name that you want to pass to SAP or just pass in todays date. Here is how both of those look
{Cube.ApplyParameter, "[!V000002]", {Parameter}},
or
{Cube.ApplyParameter, "[!V000002]", {"[ZINV_DUE].[" & TodaysDate & "]"}},
Play with both of these and see which one works for you. You could even create a function where the function would take a date and a parmater name and spit out the results. The function could be created so that it's generic and could work with many different data types or variables. That said, it would still follow this same type of implementation.
{Cube.ApplyParameter, "[!V000002]", {fnCreateParameter("ZINV_DUE", TodaysDate}},
which would return the following (Of course you would have to create the function in this scenario).
[ZINV_DUE].[20190930]
Hopefully this helps.