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
Anonymous
Not applicable

Add New Column that query data from another table based on Slicer selection

Hi All,

 

Appreciate if you guys can help.

 

I have two tables:

1. Schedule Table

2. Profile Table

 

I would like to add additional column in my schedule table, based on the selection of the profile, to query the latest part no from my profile table for each model no and output the part no to the new column.

 

Schedule table with profile slicer:

jenas6423_0-1601455686249.png

Profile table:

jenas6423_1-1601455858630.png

this can be done in sql with join statement, but i want to integrate with slicer selection to output the part no. Please advise. Thank you.

 

Regards

 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Please show a few rows of both tables and also show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

Thank you for the reply. Please find the following details:

 

Schedule Table:

image.png

Profile Table:

image.png

 

I have schedule table which show the production schedule of model and profile table which store the part no for each model. Because each model have a few part no and each part no production line only require to see relevant part no. Hence, based on user selection of profile with the slicer, I want to show only the selected part no to the user.

 

Example:

When I choose 'Carton Box' from my slicer, it should query my profile table for the part no for each model no from my schedule table and add new column of part no for carton box only into my schedule table.

image.png

 

image.png

Hope it clarifies. Thank you.

 

Regards.

 

Jenas

 

Hi,

I am still not clear.  Please share small dummy datasets (which are easy to read and understand) and on that, please show the expected result.  Also, share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

Please refer to the attached pbi file. The dateset had been imported to the report. 

 

https://drive.google.com/file/d/1W3jj0nzmyL24LySgyHvMFHuSHJpXnvsf/view?usp=sharing

 

 

For the expected result, I wanted to add a new column to my schedule table with profile selected. The column shoud be the part no of the selected profile for respective model at each line. 

 

I hope below pictures can explain what  I wanted. Thank you for your time.

 

image.png

Hi,

In the Schedule Table, write this calculated column formula

=Column = LOOKUPVALUE(Profile[PartNo],Profile[id],Schedule[ID])

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi All,

 

Anyone can assist on this? Appreciate it!

 

Regards.

 

Jenas

Pragati11
Super User
Super User

Hi @Anonymous ,

 

Is there a common column in both of your tables? If yes trying creating a relationship between these 2 tables.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

Yes I have created the relationship between this two tables. But the profile table contains duplicate records, so I would need to filter out the latest profile for that model no.

 

With the slicer involved, do you know how to construct the dax? Please advise. Thank you.

 

Regards.

 

Jenas

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.