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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Direct Query with Parameter in where clause

Hi Friends,

I am using one Direct Query in my Report for example :

select * from Invoice_master where Invoice_no = 'Inv101'

I want to use parameter in my Direct Query intead of Invoice_no='Inv101'

I tried query parameter but not success

I had created one more data set with distinct Invoice_no and then created parameter using query in this parameter,
I also changed the Mquery of this report and removed the hard coded Invoice_no='Inv101' and Placed Invoice_no='"&Inv&"'
but the report is showing only the data of given default value in parameter and it's not changing into Direct Query

Thanks
Kamal
kamal.maru@yahoo.com

Status: Needs Info
Comments
v-jiascu-msft
Employee

Hi @kammaru,

 

It works fine in my test. 

1. Were there any error messages?

2. Can you share some snapshots?

3. The type of the parameter should be the same with the field in the DB.

The M code in my test:

let
    monthp = month,
    Source = Sql.Database("dale2016", "fortest", [Query="select * from st2 where month = '"&monthp&"'"])
in
    Source

Best Regards,

Dale

Vicky_Song
Impactful Individual
Status changed to: Needs Info