Forum Discussion
Dynamic MDX query
Thank you for your comments.
The link to page where using R is a proposed solution is not working. Could you please repost the link ?
Ideally, if Live Connection to Multi-dimensional Cube functionality is not limited (can't create measures etc) I would be using that. Hopefully, live connections becomes more flexible.
I think i might follow the tutorials by Guy in a Cube that you shared. Seems to be the closest solution to what I'm trying to do. Although I'm running into 'string to numeric' conversion issues in the MDX query. I created a new parameter 'StudyID' as shown below in the image.
However, Im getting the following error when i replace the value 18563 in my original query to '&StudyID'. What will be the correct way to reference studyid parameter in the M query.
Bit late to the party but thought I'd join in! :)
The syntax that works for me is...
"&StudyID&"
The trick to editing an MDX is to not try and edit the Query string from within the Analysis Services call. Instead, create a Variable in M Code to hold your Query as a string, then you can edit this before its passed to the Analysis Services call.
It is also possible to use MDX queries to create lists that can then act as selections for your variables. I am not sure a visualisation could control the data pull though, I think you would need the user to understand parameters in Power BI.