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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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.

 

3 REPLIES 3
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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors