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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
rahul_dt
Frequent Visitor

Pass SelectedValue's ID as Parameter to a DirectQuery

Let's say I have a table as below which I've created a DirectQuery Dataset of in my Power Bi Desktop

SELECT * FROM CUST

IDName
1Michael
2Jim
3Pam


I have created a slicer over the column Name, however, I want to map the corresponding ID with the M Query Parameter so I can achieve the below requirement.

I have another Table as below that I'm trying to import in DirectQuery using M Query Parameters 

SELECT * FROM CUST_INFO WHERE CUST_ID = *id_param*

 

the id_param needs to be linked to the ID column of the CUST table, however, I don't want to create a slicer on the ID column, instead I want to create the slicer on the Name column so the user can select a name and a card/table visual refreshes and displays the selected users information.

 

Is there a way to do this such that I don't have to convert either of these table to Import Mode? Business requires it to be a DirectQuery.

 

4 REPLIES 4
rargyle
Advocate II
Advocate II

Hi, did you ever find a solution or workaround for this? I need to do the same...
many thanks

priyankadureja
Frequent Visitor

I alos have exact same requirement. Please let me know if there is any solution

Anonymous
Not applicable

Hi @rahul_dt ,

 

Currently, only one field can be bound to an M parameter.
Dynamic M query parameters in Power BI Desktop - Considerations and limitations

 

If the ID and Name are one-to-one, you can modify the query to apply the conditions that were previously applied to the [ID] to the [Name], so that [Name] can be used as the slicer value.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Hi, thanks for your reply!

I understand only one field can be bound to an M parameter, but I'd like to use the [Name] column as slicer values, however, the parameter must be bound to [ID] column. 

And on the basis of what slicer value is selected, the corresponding ID values must be passed to the second query.

The [ID] and [Name] columns both belong to the same table such that the [ID] column is a primary key

Please let me know if I can provide more information to help provide a context.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.