Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
hvjanuario
Frequent Visitor

connecting to dynamic web url - problem with m query

Hello,

I'm trying to connect to a dynamic url source and using parameters to control the source as described in

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

and I seem to be missing an important step which is in the referencing of the parameters in M query (i have never done something like this and have no idea what i'm doing honestly).

 

From what i understand i have to directly reference the parameters in the M query but i have no idea how to do it. Is anyone able to explain me how to solve this?

 

At this point i have performed every step on the link above, except i can´t bind the parameter to a field (and i think my m query is at fault).

My current M query looks like this:

let
    Source = Csv.Document(Web.Contents("---first part of link---" & medida & "---last part of link---"),[Delimiter="|", Columns=8, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"NºProj", Int64.Type}, {"Nome", type text}, {"nup", type text}, {"DataDecisão", type date}, {"Aviso", type text}, {"Medida", type text}, {"Aut.Gestão", type text}, {"Organismo", type text}})
in
    #"Changed Type"

where "medida" is my parameter i need to use (i removed the link for privacy sake).

 

So it doesn't look anything like i think it should. I would really appreciate some help on this if anyone knows what i'm missing.

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Hi @hvjanuario ,

 

As far as I know, dynamic M query parameters are only available for DirectQuery mode, not for import mode.

 

Dynamic M query parameters in Power BI Desktop (preview) :

With Dynamic M Query Parameters, model authors have more control over how filter selections get incorporated into DirectQuery source queries. 

 

And your data source (web and csv) does not support DirectQuery.

Power BI data sources :

vkkfmsft_0-1643265103813.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@hvjanuario , what is your source?  Dynamic M parameter is limited to M sources. I think Big query is one of them

@amitchandakwhat do you mean when you say what is my source?

It's a "web" source, as in a link to an internal server that exctracts data from my database.

It returns a table based on a script in said server.

 

I'm honestly not sure how else to explain it. I know they have this working with an excel sheet, but no one in my team knows how it was set up, it's an old file that everyone just changes a bit over time, but the source is still the same since the last 4/5 years, and now i have to move it to a powerbi solution somehow.

 

I know there is a simpler way to extract the data from my database, but that is how it is set up right now and it's not in my power to change it yet.

Hi @hvjanuario ,

 

As far as I know, dynamic M query parameters are only available for DirectQuery mode, not for import mode.

 

Dynamic M query parameters in Power BI Desktop (preview) :

With Dynamic M Query Parameters, model authors have more control over how filter selections get incorporated into DirectQuery source queries. 

 

And your data source (web and csv) does not support DirectQuery.

Power BI data sources :

vkkfmsft_0-1643265103813.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.